Forum Discussion
ribisht17
9 months agoSuper User
MINX with Temp Table
Hello Community,
I want to show Scores from different location and then pick the one with the lowest score.
Actually I need to show this via Bar Chart hence needed a temp table to sh...
- 9 months ago
Hi,
Please try something like below.
test_minx_fixed = IF( CONTAINSSTRING(SELECTEDVALUE(Location_Temp[Location]), "Over"), MINX( FILTER(ALL(Location_Temp[Location]), Location_Temp[Location] <> "Overall Minimum"), CALCULATE(SUM(Fact_Employee_Training[Score])) ), CALCULATE( SUM(Fact_Employee_Training[Score]), Dim_Employee[Location] = SELECTEDVALUE(Location_Temp[Location]) ) )
Shahid12523
9 months agoCommunity Champion
Your second formula returns blank because MINX lacks row context—CALCULATE(SUM(...)) isn’t filtered per location. Also, CALCULATE(..., Dim_Employee[Location] = ...) is invalid syntax unless wrapped in a FILTER().
Fix: Use FILTER() inside MINX to apply location context:
MINX(
VALUES(Dim_Employee[Location]),
CALCULATE(
SUM(Fact_Employee_Training[Score]),
FILTER(
ALL(Dim_Employee),
Dim_Employee[Location] = EARLIER(Dim_Employee[Location])
)
)
)
ribisht17
9 months agoSuper User
Thanks Shahid,
Unfortunately your solution is not working
(update)
However, the same DAX works here
Regards,
Ritesh