Forum Discussion
Sirhawk3017
Helper II
1 year agoPower BI: Need Help Creating Quarterly Rank and Quartiles
I need help creating quartiles in Power BI based on a quarterly rank, but I don't have the ranking measure yet. I want to:
- Create a measure that ranks my sales data each quarter
- Divide my data into four quartiles (Quartile 1 being the top, Quartile 4 the bottom) based on this newly created quarterly rank.
- Display the average of the ranked numerical field for each quartile in separate card visuals above a table. The table should show the detailed data, including the quarter, the numerical field, the quarterly rank, and the quartile assignment.
tried this formula and seemed to work;
Quartile =VAR RankedTable =ADDCOLUMNS(ALL(Medic_Info),"Rank", [FM Sales QTD Rank] // Add a temporary rank column)VAR MaxRank = MAXX(RankedTable, [Rank]) // Get the max rank from the temporary tableVAR QuartileSize = CEILING(MaxRank / 4, 1)RETURNSWITCH(TRUE(),[FM Sales QTD Rank] <= QuartileSize, 1,[FM Sales QTD Rank] <= QuartileSize * 2, 2,[FM Sales QTD Rank] <= QuartileSize * 3, 3,4)
2 Replies
- Sirhawk3017
Helper II
tried this formula and seemed to work;
Quartile =VAR RankedTable =ADDCOLUMNS(ALL(Medic_Info),"Rank", [FM Sales QTD Rank] // Add a temporary rank column)VAR MaxRank = MAXX(RankedTable, [Rank]) // Get the max rank from the temporary tableVAR QuartileSize = CEILING(MaxRank / 4, 1)RETURNSWITCH(TRUE(),[FM Sales QTD Rank] <= QuartileSize, 1,[FM Sales QTD Rank] <= QuartileSize * 2, 2,[FM Sales QTD Rank] <= QuartileSize * 3, 3,4) - AnonymousNot applicable
Hi,Sirhawk3017 .
Congratulations!
It's great to see that you solved your problem and that you shared the method to the forum.