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,
I am trying to use column instead of measure based on a value in swith/if statement but seems like Column value doesn't change.
e.g.
Solved! Go to Solution.
Hi @Anonymous,
There is some difference between the calculated column and measure, the value of a calculated column is computed during data refresh and uses the current row as a context; it does not depend on user interaction in the report. A measure operates on aggregations of data defined by the current context, which depends on the filter applied in the report – such as slicer, rows, and columns selection in a pivot table, or axes and filters applied to a chart.
You could refer to below link:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
Regards,
Daniel He
Hi @Anonymous,
There is some difference between the calculated column and measure, the value of a calculated column is computed during data refresh and uses the current row as a context; it does not depend on user interaction in the report. A measure operates on aggregations of data defined by the current context, which depends on the filter applied in the report – such as slicer, rows, and columns selection in a pivot table, or axes and filters applied to a chart.
You could refer to below link:
https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/
Regards,
Daniel He
Hi Sud,
Calculated columns are under a row context and the measures are in a filter context.
Try using the CALCULATE function to change the context of the measure (Context Transition):
Column = CALCULATE (SWITCH ([Measure], "Hey", 1, "Hello", 2))
Tell us if it works for you.
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 |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |