DAX 和 FORMAT 函数

编程入门 行业动态 更新时间:2024-10-24 10:21:09
本文介绍了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")

这可能对你有用:

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

更多推荐

DAX 和 FORMAT 函数

本文发布于:2023-10-30 19:33:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1543791.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   DAX   FORMAT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!