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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.