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.
Result =
VAR SecondLast = CALCULATE(MAX(Data[Units]),FILTER(ALL(Data[Units]),Data[Units]<MAX(Data[Units])))
RETURN
CALCULATE(VALUES(Data[Units]),FILTER(ALL(Data),Data[Units]=SecondLast))
In SecondLast I am trying to get the second Max Unit available
& finally trying to get the second Max Unit available for whatever the selection I have put in from other columns e.g. Items, Dates etc
But seems like there is no result (blank) in this SecondLast variable and hence no result at all.
Things are harder when you have nested CALCULATE statements. You may try using RANKX Function instead.
Thanks but what I am curious about is that it is working without the columnname and not with it.
ALL(Data[Units]) - not working
ALL(Data[Units]) - removing column name worked
Removing Column Name and keeping the Table Name did the thing, but WHY and HOW ? It doesn't matter if I keep whole Table or a single Column.
Result =
VAR SecondLast = CALCULATE(MAX(Data[Units]),FILTER(ALL(Data[Units]),Data[Units]<MAX(Data[Units])))
RETURN
CALCULATE(VALUES(Data[Units]),FILTER(ALL(Data),Data[Units]=SecondLast))
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 |
---|---|
115 | |
99 | |
88 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |