DAX and FORMAT function

不羁岁月 提交于 2021-02-11 13:56:21

问题


i have a field for date with date, month and year.In my visualization, I need date to be displayed in (MON-Year) format. I switched to data view, created calculated column with

Mon-Year = FORMAT('table'[Date],"YYYY-MM")

Now it's getting displayed as (YEAR and Month number) but I want to change it as month name. After changes in data view, when I close apply, the column is present but there is no data type visible.

enter image description here

Should I create different calculated fields for year and month separately and then concatenate it? any help would be appreciated.


回答1:


If you want month first, then maybe you should specify it that way.

Mon-Year = FORMAT('table'[Date],"MMM-YYYY")

This may be useful for you:

https://docs.microsoft.com/en-us/dax/custom-date-and-time-formats-for-the-format-function



来源:https://stackoverflow.com/questions/61763328/dax-and-format-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!