Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Power BI Community,
We have a requirement where we have the data coming from Excel as below :
We are trying in Power BI to get the sales data sorted in the descending order and then rank them as Highest sales as 1 and so on. And the using this rank to do a percentage of Max rank as below in the last column :
I would appreciate any help on this.
@Greg_Deckler @amitchandak @tamerj1 @SpartaBI
Thanks,
Deepak
Solved! Go to Solution.
Hi @DeepakJha23
Please refer to the sample file with the solution https://we.tl/t-40Y6zDV7U8
Sales Amount = SUM ( Sales[Sales] )
Rank = RANKX ( ALLSELECTED ( Sales[Product] ), [Sales Amount] )
% of Max Rank =
VAR TotalSales = CALCULATE ( [Sales Amount], ALLSELECTED ( Sales[Product] ) )
VAR CurrentRank = [Rank]
VAR T1 = ADDCOLUMNS ( ALLSELECTED ( Sales[Product] ), "@Amount", [Sales Amount] )
VAR T2 = TOPN ( CurrentRank, T1, [@Amount] )
VAR CommulativeSales = SUMX ( T2, [@Amount] )
RETURN
DIVIDE ( CommulativeSales, TotalSales )
Hi @DeepakJha23
Please refer to the sample file with the solution https://we.tl/t-40Y6zDV7U8
Sales Amount = SUM ( Sales[Sales] )
Rank = RANKX ( ALLSELECTED ( Sales[Product] ), [Sales Amount] )
% of Max Rank =
VAR TotalSales = CALCULATE ( [Sales Amount], ALLSELECTED ( Sales[Product] ) )
VAR CurrentRank = [Rank]
VAR T1 = ADDCOLUMNS ( ALLSELECTED ( Sales[Product] ), "@Amount", [Sales Amount] )
VAR T2 = TOPN ( CurrentRank, T1, [@Amount] )
VAR CommulativeSales = SUMX ( T2, [@Amount] )
RETURN
DIVIDE ( CommulativeSales, TotalSales )
@DeepakJha23 , Try like
divide([Rank], maxx(Values(Table[Product]), [Rank]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
76 | |
62 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |