Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have these numbers that are correct:
So for mth 1 2023 the LBE1 = 234,181 and LBE2 = 222,889
All fine.
Now I have a second matric looking like :
From prmLBE_Comp still on Addendum and from slicer Type LBE1 is selected.
As you see the nuber matches.
However when I also select LBE2:
It adds them together. Well first thing you will say is that its logical it would do that and I agree.
But this is my measure for TypeMax:
I would expect the calculate filter to work and only take the amout belonging max MD Type ID, which is 3 in this case.
That would be LBE2 because that has the highest ID of the 2 selections.
And I know that this works because when I hardcode the measure Addendum in the measure:
What is going on here?
Why does the measure work fine with the original measure but not with the Switch variant??
Solved! Go to Solution.
LBE_Choice gets a measure assigned to it in the switch. At that point it gets a value from that measure. That is a fixed (numeric) value. It won't change.
LBE_Choice doesn't act like a kind of dynamic variable where the name of the measure is passed to the RETURN statement and then it is evaluated in the filter context given in the CALCULATE.
--
"And what name of the measure is not in the Switch?" - that's not what i'm saying. The switch works fine, it's just not doing what you think it's doing.
Ah right @HotChilli now I understand what you mean. Cannot say I find it logical from Power BI but the measure it reports gets already determined in the switch.
The Return does not really much than but pick the correct option in the switch.
Well for people with the same problem.
I was able to fix this issue by the following:
LBE_Choice gets a measure assigned to it in the switch. At that point it gets a value from that measure. That is a fixed (numeric) value. It won't change.
LBE_Choice doesn't act like a kind of dynamic variable where the name of the measure is passed to the RETURN statement and then it is evaluated in the filter context given in the CALCULATE.
--
"And what name of the measure is not in the Switch?" - that's not what i'm saying. The switch works fine, it's just not doing what you think it's doing.
Ah right @HotChilli now I understand what you mean. Cannot say I find it logical from Power BI but the measure it reports gets already determined in the switch.
The Return does not really much than but pick the correct option in the switch.
Well for people with the same problem.
I was able to fix this issue by the following:
The SWITCH version isn't working like you think it is. The LBE_Choice is evaluated in the SWITCH. It doesn't hold the name of the measure and then only evaluate that in the DAX on the last line.
Thanks @HotChilli but I am not sure if I fully understand what you mean.
Can my Switch not be changed so it will work?
And what name of the measure is not in the Switch? Looks to me like all measures I want to use are in the switch.
User | Count |
---|---|
97 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
96 | |
95 | |
64 | |
57 |