Forum Discussion
Using a Measure or a Variable in a Measure doesn't work - but the Number does?
Hi elsteshepardo ,
Is it possible that getting 'Status'[Status]=maximum value of current DS Requests'[Status]'Status'[Order]) is itself less than or equal to 6, so it all comes up with the same result when it comes to the IF() function
The use of Var() function: you can temporarily save the value of the expression output in the form of a named variable, then you can pass it as a parameter to other metrics, and mesaure display a single value is different, var() can save a single value, you can save a whole virtual table of data, the value displayed is unchanged.
For more details about VAR, you may read the REMARKS:
https://docs.microsoft.com/en-us/dax/var-dax
[DAX] Why and how to use variables - Microsoft Fabric Community
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Not sure - all I know is that the result I want to achieve only works when I enter a number, rather than use some kind of function
Being consistent with the above post - using 6 in the Measure (which is equal to Approved to next stage) I get this result
But when I use something else, like
VAR _Selected_Status_Nr =
CALCULATE(MAX('Status'[Order]),'Status'[Status] = _Selected_Status)
It doesn't work, I get this
But I know that the calculation is correct, because
CALCULATE(MAX('Status'[Order]),'Status'[Status] = _Selected_Status)
for this example, returns 6