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

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.

Reply
rahuldas_vgm
Helper I
Helper I

Finding minimum rank per date

Hello,

 

I am currently stuck with a problem. I have a rank column which ranks Columns with ID as per the ranking list. I wanted to find out the best rank as per the day. If the same ID has 3 different ranks in a day it should show me the best rank for that day. Instead what it is doing is, giving me the best rank from all the dates of its entry. Here are the DAX I'm Using:

 

Best Rank = CALCULATE(IF(SELECTEDVALUE('All Detailed APR'[Status])="ANSWERED",CALCULATE(MIN('All Detailed APR'[Rank]),ALLEXCEPT('All Detailed APR','All Detailed APR'[ID Number])),8))
 
rahuldas_vgm_0-1671604096420.png

 

 

Thank You for your help!

1 ACCEPTED SOLUTION
rahuldas_vgm
Helper I
Helper I

Thank you for your help @Mahesh0016 .I had forgotten to put DISTINCT(File Date) in the formula to get the minimum rank for each date. The thing worked as soon as I changed the formula to:

 

Best Rank = CALCULATE(IF(SELECTEDVALUE('All Detailed APR'[Status])="ANSWERED",CALCULATE(MIN('All Detailed APR'[Rank]),

DISTINCT('All Detailed APR'[File Date]),ALLEXCEPT('All Detailed APR','All Detailed APR'[ID Number])),8))

View solution in original post

3 REPLIES 3
rahuldas_vgm
Helper I
Helper I

Thank you for your help @Mahesh0016 .I had forgotten to put DISTINCT(File Date) in the formula to get the minimum rank for each date. The thing worked as soon as I changed the formula to:

 

Best Rank = CALCULATE(IF(SELECTEDVALUE('All Detailed APR'[Status])="ANSWERED",CALCULATE(MIN('All Detailed APR'[Rank]),

DISTINCT('All Detailed APR'[File Date]),ALLEXCEPT('All Detailed APR','All Detailed APR'[ID Number])),8))
rahuldas_vgm
Helper I
Helper I

I am trying to find the Best Rank for each date and not the best rank (minimum value) amongst all the dates. Like for File Date value 8th December the minimum is 2 as the two values are 2 and 8 so minimum for that day is 2 instead of 1 which is minimum amongst all the dates. Something like this:

 

rahuldas_vgm_0-1671611037189.png

 

Mahesh0016_0-1671612365881.png

>>Create Calculated column.

 

BestRank = CALCULATE(MIN('File Date'[Rank]),ALLEXCEPT('File Date','File Date'[File Date]))

Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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