Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello, I ask for your help in order to do the following: I have a Matrix as the attachment I need to get the rank based on a brand level but the ranking is from the store. (The attached file is the final result I want to obtain)
Rank =
VAR IsCountryFiltred =
ISFILTERED ( Catalogo_Reporte_Diario[Customer_Name] )
VAR IsTitleSeasonFiltered =
ISFILTERED ( Catalogo_Reporte_Diario[Grand_Brand])
VAR IsTitleSeason =
HASONEVALUE ( Catalogo_Reporte_Diario[Grand_Brand] )
RETURN
IF (
ISBLANK ( [Amount] ),
BLANK (),
IF (
IsCountryFiltred && IsTitleSeasonFiltered,
RANKX ( ALL ( Catalogo_Reporte_Diario[Customer_Name] ), [Amount],, DESC, SKIP ),
IF (
IsTitleSeasonFiltered && NOT IsCountryFiltred,
RANKX ( ALL ( Catalogo_Reporte_Diario[Retailer_Name] ), CALCULATE ( [Amount] ) ),
BLANK ()
)
)
)
Solved! Go to Solution.
Hi @vazmor ,
Try to add the following column to your table:
Rank =
CALCULATE(
COUNTROWS(Catalogo_Reporte_Diario);
FILTER(
ALL(Catalogo_Reporte_Diario);
Catalogo_Reporte_Diario[Grand_Brand] = EARLIER(Catalogo_Reporte_Diario[Grand_Brand]) &&
Catalogo_Reporte_Diario[AMOUNT] < EARLIER(Catalogo_Reporte_Diario[AMOUNT])
)
)+1
If you prefer to use a measure try the following:
Rank =
CALCULATE(
COUNTROWS(Catalogo_Reporte_Diario);
FILTER(
ALL(Catalogo_Reporte_Diario);
Catalogo_Reporte_Diario[Grand_Brand] = SELECTEDVALUE(Catalogo_Reporte_Diario[Grand_Brand]) &&
Catalogo_Reporte_Diario[AMOUNT] < SELECTEDVALUE(Catalogo_Reporte_Diario[AMOUNT])
)
)+1
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @vazmor ,
Try to add the following column to your table:
Rank =
CALCULATE(
COUNTROWS(Catalogo_Reporte_Diario);
FILTER(
ALL(Catalogo_Reporte_Diario);
Catalogo_Reporte_Diario[Grand_Brand] = EARLIER(Catalogo_Reporte_Diario[Grand_Brand]) &&
Catalogo_Reporte_Diario[AMOUNT] < EARLIER(Catalogo_Reporte_Diario[AMOUNT])
)
)+1
If you prefer to use a measure try the following:
Rank =
CALCULATE(
COUNTROWS(Catalogo_Reporte_Diario);
FILTER(
ALL(Catalogo_Reporte_Diario);
Catalogo_Reporte_Diario[Grand_Brand] = SELECTEDVALUE(Catalogo_Reporte_Diario[Grand_Brand]) &&
Catalogo_Reporte_Diario[AMOUNT] < SELECTEDVALUE(Catalogo_Reporte_Diario[AMOUNT])
)
)+1
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThe Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |