admin管理员组文章数量:1334165
I am trying to calculate a table where I can see the YTD values with this DAX:
Is YTD =
IF (
'Append'[Attribute - Date] >= DATE ( YEAR ( DISTINCT ( 'Append'[Date Ref.EoMonth] ) ), 1, 1 )
&& 'Append'[Attribute - Date] <= DISTINCT ( 'Append'[Date Ref.EoMonth] ),
"YTD",
"Other"
)
But I get A table of multiple values was supplied where a single value was expected
I am trying to calculate a table where I can see the YTD values with this DAX:
Is YTD =
IF (
'Append'[Attribute - Date] >= DATE ( YEAR ( DISTINCT ( 'Append'[Date Ref.EoMonth] ) ), 1, 1 )
&& 'Append'[Attribute - Date] <= DISTINCT ( 'Append'[Date Ref.EoMonth] ),
"YTD",
"Other"
)
But I get A table of multiple values was supplied where a single value was expected
Share Improve this question edited Nov 20, 2024 at 14:37 Amira Bedhiafi 1 asked Nov 20, 2024 at 10:35 Yolanda CBYolanda CB 156 bronze badges1 Answer
Reset to default 0In your case DISTINCT returns a table of values but DAX expects a single value for comparison in your IF statement. Try to use MAX or MIN to get a single value returned from 'Append'[Date Ref.EoMonth] which DAX can use for comparison :
Is YTD =
IF (
'Append'[Attribute - Date] >= DATE ( YEAR ( MAX ( 'Append'[Date Ref.EoMonth] ) ), 1, 1 )
&& 'Append'[Attribute - Date] <= MAX ( 'Append'[Date Ref.EoMonth] ),
"YTD",
"Other"
)
本文标签: dateA table of multiple values was supplied where a single value was expected YTDStack Overflow
版权声明:本文标题:date - A table of multiple values was supplied where a single value was expected YTD - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742364631a2461039.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论