The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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]))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
80 | |
62 | |
57 |
User | Count |
---|---|
246 | |
119 | |
114 | |
86 | |
70 |