Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
IIF(Fields!Date.Value ="12/31/9999", "END",Fields!Date.Value)
Is is possible to create measure with above condition?As my source is tabular model, i can't use calculated column for above condition.
Solved! Go to Solution.
Hi @Anonymous ,
"END" is a Text string, while Fields!Date.Value is a Date type value. Measure doesn't support to return values with different data types. In your scenario, you could convert [Date] to Text with below DAX formula.
Measure = IF ( SELECTEDVALUE ( TableName[Date] ) = DATE ( 9999, 12, 31 ), "END", FORMAT ( TableName[Date], "" ) )
Alternatively, you could replace "END" with blank.
Measure = IF ( SELECTEDVALUE ( TableName[Date] ) = DATE ( 9999, 12, 31 ), BLANK(),
SELECTEDVALUE(TableName[Date])
)
Best regards,
Yuliana Gu
Hi @Anonymous ,
"END" is a Text string, while Fields!Date.Value is a Date type value. Measure doesn't support to return values with different data types. In your scenario, you could convert [Date] to Text with below DAX formula.
Measure = IF ( SELECTEDVALUE ( TableName[Date] ) = DATE ( 9999, 12, 31 ), "END", FORMAT ( TableName[Date], "" ) )
Alternatively, you could replace "END" with blank.
Measure = IF ( SELECTEDVALUE ( TableName[Date] ) = DATE ( 9999, 12, 31 ), BLANK(),
SELECTEDVALUE(TableName[Date])
)
Best regards,
Yuliana Gu
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
96 | |
79 | |
67 | |
62 |
User | Count |
---|---|
137 | |
106 | |
104 | |
81 | |
63 |