Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anshenterprices
Helper IV
Helper IV

How to calculate percentage ranking

DateCategory1DaySalesRankpercent rank
4/6/2021Equity1234100
4/6/2021Equity345375
4/6/2021Equity567250
4/6/2021Equity789125
4/6/2021Commodity4532100
4/6/2021Commodity564150
4/6/2021Currency2341100
4/5/2021Equity256375
4/5/2021Equity04100
4/5/2021Equity345250
4/5/2021Equity754125
4/5/2021Commodity6831100
4/5/2021Commoditynull  
4/5/2021Currency2463300


I want to calculate rank and percent rank

In report i have slicer Date, Category 

Ranking is based on 1daysales by the selection of date and category 
percent rank forumula= ranking*100/counta(1daysales)

Note :- if its blank dont assign rank and percent rank


1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anshenterprices , Create two measures like

 


Rank = rankx(filter(allselected(Table[DAte], Table[Category]), [Category] =max([category]) ), calculate(sum(table[1DaySales])))

count Day = calculate(count(Table[Date]), filter(allselected(Table), Table[Date] = max(Table[Date]) && Table[category] = max(Table[category]) ))

 

 

and then %

% = divide([Rank], [count day])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
Anshenterprices
Helper IV
Helper IV

@amitchandak Thank you so much

amitchandak
Super User
Super User

@Anshenterprices , Create two measures like

 


Rank = rankx(filter(allselected(Table[DAte], Table[Category]), [Category] =max([category]) ), calculate(sum(table[1DaySales])))

count Day = calculate(count(Table[Date]), filter(allselected(Table), Table[Date] = max(Table[Date]) && Table[category] = max(Table[category]) ))

 

 

and then %

% = divide([Rank], [count day])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak  thank you
forgot to mentioned in the post, In a table there is also one column i.e. online/offline category , 
I have used online/offline category as a Slicer in the report,but dont want seperate raking and percent rank  once i select online or offline category. it should be same in both ways

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.