Forum Discussion
kipi_bi
9 months agoFrequent Visitor
Problem with MAXX
Hello Team, I am trying to get the Maximum Score achieved by any Employee but it is getting filtered at employee level ,even after applying additional filters with ALL and REMOVEFILTER, there is ...
- 9 months ago
pls try
MaxTotalScorePerEmployee = CALCULATE( MAXX( ADDCOLUMNS( SUMMARIZE( ALL(Dim_Employee), Dim_Employee[EmployeeID] ), "TotalScore", CALCULATE(SUM(FactEmployee_Training[Score])) ), [TotalScore] ), REMOVEFILTERS() ) ---------------or------------- MaxTotalScorePerEmployee =CALCULATE( MAXX( TOPN( 1, ADDCOLUMNS( SUMMARIZE( ALL(Dim_Employee), Dim_Employee[EmployeeID] ), "TotalScore", CALCULATE(SUM(FactEmployee_Training[Score])) ), [TotalScore], DESC ), [TotalScore] ), REMOVEFILTERS() )
kipi_bi
9 months agoFrequent Visitor
Thanks a lot, it worked
Can you let me know why we need to add ADD COLUMNS to get the answer ?
Regards,
Ritz
Ahmedx
9 months agoSuper User
The SUMMARIZE function uses a clustering method. Read more about it here.
https://www.sqlbi.com/articles/differences-between-groupby-and-summarize/
Also, keep in mind that using the REMOVEFILTERS() function ensures that all filters are removed.