cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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])

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])

@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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors