DAX和FORMAT功能 [英] DAX and FORMAT function

查看:46
本文介绍了DAX和FORMAT功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日期,日期,月份和年份的字段.在我的可视化中,我需要以(MON-Year)格式显示日期.我切换到数据视图,使用创建了计算列

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.

我应该分别为年和月创建不同的计算字段,然后将其串联起来吗?任何帮助将不胜感激.

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

推荐答案

如果您想先选择月份,那么也许应该这样指定.

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

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

这可能对您有用:

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

这篇关于DAX和FORMAT功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆