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
https://preppindata.blogspot.com/2023/02/2023-week-5-dsb-ranking.html
this is my table - I wanted to aggregate the total by their rank using a measure
| Month | Bank | Sum of Value | rank |
| April | DTB | 42360 | 1 |
| April | DS | 40785 | 2 |
| April | DSB | 30317 | 3 |
| August | DS | 102237 | 1 |
| August | DTB | 66063 | 2 |
| August | DSB | 38167 | 3 |
| December | DTB | 63797 | 1 |
| December | DS | 33952 | 2 |
| December | DSB | 20785 | 3 |
| February | DTB | 43400 | 1 |
| February | DS | 31204 | 2 |
| February | DSB | 28622 | 3 |
| January | DTB | 67063 | 1 |
| January | DS | 50207 | 2 |
| January | DSB | 45036 | 3 |
the result should be like this
| rank | Average of Sum of Value |
| 1 | 66967.75 |
| 2 | 48633.67 |
| 3 | 34620.83 |
I achieved this by exporting the data and uploading it as a new table.
I wanted to know it was possible to get the same result with a measure
thanks
Solved! Go to Solution.
Hi , @xnatsu24
According to your description, you create a rank measure to get the rank . And you want to group by the rank and get the average of the value .
Here are the steps you can refer to :
(1)This is my test data and my understand for your need:
(2) We can click "New Table" to create a dimension table :
Table 2 = var _max_count = MAXX(SUMMARIZE('Table','Table'[Month],"count" , COUNT('Table'[Bank])) , [count])
return
GENERATESERIES(1,_max_count,1)
(3)Then we can click "New Measure" and enter this to create a measure:
Measure = var _t =ADDCOLUMNS( SUMMARIZE('Table','Table'[Month],'Table'[Bank],"value", SUM('Table'[Value])) , "rank" , [rank])
var _cur_rank = VALUES('Table 2'[Value])
return
AVERAGEX(FILTER(_t, [rank] in _cur_rank) , [value])
Then we can put the fields we need on the visual and we can get this:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi,
This can be solved with a disconncted table. Share the raw sample data in a format that can be pasted in an MS Excel file.
Hi , @xnatsu24
According to your description, you create a rank measure to get the rank . And you want to group by the rank and get the average of the value .
Here are the steps you can refer to :
(1)This is my test data and my understand for your need:
(2) We can click "New Table" to create a dimension table :
Table 2 = var _max_count = MAXX(SUMMARIZE('Table','Table'[Month],"count" , COUNT('Table'[Bank])) , [count])
return
GENERATESERIES(1,_max_count,1)
(3)Then we can click "New Measure" and enter this to create a measure:
Measure = var _t =ADDCOLUMNS( SUMMARIZE('Table','Table'[Month],'Table'[Bank],"value", SUM('Table'[Value])) , "rank" , [rank])
var _cur_rank = VALUES('Table 2'[Value])
return
AVERAGEX(FILTER(_t, [rank] in _cur_rank) , [value])
Then we can put the fields we need on the visual and we can get this:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |