Forum Discussion
Filter records from Power BI Summarize table
- 6 years ago
Not sure how you are calculating your "max" but here is a table expression that gets your desired result from your example table. This one determines max alphabetically, but you can substitute in another expression inside the CALCULATE if that is not correct.
Main Summary = ADDCOLUMNS ( SUMMARIZE ( Main, Main[Id] ), "Region", CALCULATE ( MAX ( Main[Region] ) ) )If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years ago
Hi mahoneypat , amitchandak ,
Thank you so much for your reply!
I tried the below expression and it works perfect.
Emp_Count_Region = SUMMARIZE(FILTER(SUMMARIZE(Main , Main[Id], Main[Region] ),RANKX(FILTER(SUMMARIZE(Main , Main[Id], Main[Region]), Main[Id]=EARLIER(Main[Id])),CALCULATE(count('Main'[Region]), ALLEXCEPT(Main, Main[Id], Main[Region])) , , DESC) =1), Main[Id], "Region1", calculate(max(Main[Region])))Thanks!Rinku
Not sure how you are calculating your "max" but here is a table expression that gets your desired result from your example table. This one determines max alphabetically, but you can substitute in another expression inside the CALCULATE if that is not correct.
Main Summary =
ADDCOLUMNS (
SUMMARIZE ( Main, Main[Id] ),
"Region", CALCULATE ( MAX ( Main[Region] ) )
)
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat