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.
Hi ALL ,
Basically I would like to understand the behaviour of the below dax and what would be the best way to write the same for the scenario mentioned below.
I have a calculated column -
Solved! Go to Solution.
Hi @Anonymous,
it's due to the code for the measure TARGET. If there is no filter context on year, [YEAR] will return all years available in that column, and the engine don't know what year to use. You would have to decide which value to use when there is no filter context for year.
One option is to return blank:
TARGET =
IF (
HASONEVALUE ( [Year] ),
SWITCH ( VALUES ( [year] ), 2016, 3.8, 2015, 3.8, 2017, 3, 2, 3.1 ),
BLANK ()
)
best regards,
Sturla
Hi @Anonymous,
it's due to the code for the measure TARGET. If there is no filter context on year, [YEAR] will return all years available in that column, and the engine don't know what year to use. You would have to decide which value to use when there is no filter context for year.
One option is to return blank:
TARGET =
IF (
HASONEVALUE ( [Year] ),
SWITCH ( VALUES ( [year] ), 2016, 3.8, 2015, 3.8, 2017, 3, 2, 3.1 ),
BLANK ()
)
best regards,
Sturla
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 |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |