如何使用 Format Function 、 DAX 、 Power BI 更改日期格式?

how can i change the format of the date by using Format Function , DAX , Power BI?

我有一个列 "Sta" 类型 date/time,我想将它的格式更改为这种格式 "YYYYMM",或者 "MM-YYYY" 为新格式列。

每次我想将列的格式更改为新格式时都会出现此错误!!!!

知道如何使用格式函数更改格式吗?

您使用的格式函数只需要一行。用一个Max()函数才行。

但是,您要查找的内容在关系选项卡中:

点击您的日期栏,然后转到 Properties > Date time Format > Custom Format:

在这里您可以输入您的自定义格式。

documentation that FORMAT function is not supported for use in DirectQuery mode. Also take a look at DAX formula compatibility in DirectQuery mode 文章中有明确说明。