The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I have a measure
Solved! Go to Solution.
Variables aren't really variable, they're constants. They're only calculated once when you define them, so they're useful for storing the results of a calculation if you want to refer to it multiple times but if you need to perform the same calculation multiple times with different filter contexts then you cannot use variables for that.
Also, a couple of general points. You shouldn't use SUMMARIZE to add calculated columns to a table, you should use SUMMARIZE just to give the static columns and wrap it in ADDCOLUMNS to add the calculations.
And you shouldn't use equality operators to compare to blank as that can give unexpected results, as 0 equals blanks. Instead of variable <> BLANK(), use NOT(ISBLANK(variable)).
Variables aren't really variable, they're constants. They're only calculated once when you define them, so they're useful for storing the results of a calculation if you want to refer to it multiple times but if you need to perform the same calculation multiple times with different filter contexts then you cannot use variables for that.
Also, a couple of general points. You shouldn't use SUMMARIZE to add calculated columns to a table, you should use SUMMARIZE just to give the static columns and wrap it in ADDCOLUMNS to add the calculations.
And you shouldn't use equality operators to compare to blank as that can give unexpected results, as 0 equals blanks. Instead of variable <> BLANK(), use NOT(ISBLANK(variable)).