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
RENJITH_R_S
Resolver I
Resolver I

Rankx based on Month wise and year wise

Hello friends,
I need a help on to find the ranking of applications based on its value in month wise and year wise. see the attachment. can you help this

 

Rank.JPG

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @RENJITH_R_S ,

Please refer to my pbix file to see if it helps you.

Create measures and columns.

total value = var _1= CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Year]=EARLIER('Table'[Year])&&'Table'[Application]=EARLIER('Table'[Application])))
return
_1
Measure = RANKX(FILTER(ALL('Table'),'Table'[Year]=SELECTEDVALUE('Table'[Year])),CALCULATE(MAX('Table'[total value])),,DESC,Dense)
Measure 2 = RANKX(FILTER(ALL('Table'),'Table'[Month]=SELECTEDVALUE('Table'[Month])&&'Table'[Year]=SELECTEDVALUE('Table'[Year])),CALCULATE(MAX('Table'[Value])),,DESC,Dense)

vpollymsft_0-1673406296373.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-rongtiep-msft
Community Support
Community Support

Hi @RENJITH_R_S ,

Please refer to my pbix file to see if it helps you.

Create measures and columns.

total value = var _1= CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Year]=EARLIER('Table'[Year])&&'Table'[Application]=EARLIER('Table'[Application])))
return
_1
Measure = RANKX(FILTER(ALL('Table'),'Table'[Year]=SELECTEDVALUE('Table'[Year])),CALCULATE(MAX('Table'[total value])),,DESC,Dense)
Measure 2 = RANKX(FILTER(ALL('Table'),'Table'[Month]=SELECTEDVALUE('Table'[Month])&&'Table'[Year]=SELECTEDVALUE('Table'[Year])),CALCULATE(MAX('Table'[Value])),,DESC,Dense)

vpollymsft_0-1673406296373.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-rongtiep-msft Thank You for your help

Thennarasu_R
Responsive Resident
Responsive Resident

Hi ! 
@RENJITH_R_S 

I Cretaed one logic It have work fine. 
Step 1
You should create one calculated column based "YYYYMMDD" this Format .It will Came we change the Integer.that also I reated.

Below Formulas.

Thennarasu_R_0-1673328799973.png

Step 2
You Should created a measure to rank based on Month Year and Date .

Thennarasu_R_1-1673328925266.png

I hope this will help to You.

Thanks,
Thennarasu

@Thennarasu_R , thanks for your input but my requirement is different

amitchandak
Super User
Super User

@RENJITH_R_S , if you need combine rank

 

rankx(allselected(Date[Year], date[Month]), [Value Meausre])

 

This will rank inside the application, if you need an application also then

 

rankx(Summarize(allselected(Fact), Fact[Application], Date[Year], date[Month]), [Value Meausre])

@amitchandak it returns value as 1 only

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.