This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello,
I am trying to rank a list of stores by sales on a period by period basis. For example, this is what a desired table would look like:
| Period | Store | Sales | Rank |
| 1 | A | 100 | 2 |
| 1 | B | 150 | 1 |
| 1 | C | 75 | 3 |
| 2 | A | 110 | 3 |
| 2 | B | 120 | 2 |
| 2 | C | 135 | 1 |
Then I would like have the sum of the ranks for each store like so:
| Store | Sum of Rank |
| A | 5 |
| B | 3 |
| C | 4 |
I am able to calculate the ranks in the first table using the following measure:
Rank =
RANKX(
FILTER(
ALL(Table[Period], Table[Store])
Table[Period] = MAX(Table[Period])
),
CALCULATE(SUM(Table[Sales])
)
Solved! Go to Solution.
Hi,
I am not sure what is your desired outcome, but I tried to create it by using measures.
Please check the below picture and the attached pbix file.
It is for creating a measure.
Expected result measure: =
VAR _rank =
ADDCOLUMNS (
VALUES ( Period[Period] ),
"@rank",
RANK (
SKIP,
SUMMARIZE ( ALL ( Data ), Store[Store], Period[Period] ),
ORDERBY ( CALCULATE ( SUM ( Data[Sales] ) ), DESC ),
PARTITIONBY ( Period[Period] )
)
)
RETURN
SUMX ( _rank, [@rank] )
Hi,
I am not sure what is your desired outcome, but I tried to create it by using measures.
Please check the below picture and the attached pbix file.
It is for creating a measure.
Expected result measure: =
VAR _rank =
ADDCOLUMNS (
VALUES ( Period[Period] ),
"@rank",
RANK (
SKIP,
SUMMARIZE ( ALL ( Data ), Store[Store], Period[Period] ),
ORDERBY ( CALCULATE ( SUM ( Data[Sales] ) ), DESC ),
PARTITIONBY ( Period[Period] )
)
)
RETURN
SUMX ( _rank, [@rank] )
This works perfectly, thank you!
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 38 | |
| 28 | |
| 27 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 37 | |
| 32 | |
| 26 | |
| 25 |