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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
fabiojoa
Helper I
Helper I

Problem with RANKX

I need realize a RANKX for all years (2020-2022) and a RANKX only for a selected year. I have two tables: fatVendas and dCalendario. 

I create a measure Total das Vendas = SUM(fatVendas[Total da Venda]). 

Create too a calculated table with:

Ranking por Mês/Ano =
     ADDCOLUMNS(
    DISTINCT(dCalendario[Mês/Ano]),
    "Receita Total", [Total das Vendas],
    "Rank Geral", RANKX(ALLSELECTED(dCalendario[Mês/Ano]), [Total das Vendas])
)
And I have this:
Rankx.png

 

And sounds good! But, I need calculate a rank in the year, when a user select a one year, show a rank in a year. How to realize this?

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Ok!

 

Here the PBI file: https://www.dropbox.com/t/ZZLrctX6bk6j4YMb

 

Thanks!

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Ashish, thanks!!!

 

What the problem in using a Month/Year or Month/Year and Year columns in table?

You are welcome.  Should not be.  Since year is already selected in the slicer, showing it in the Table is superfluous.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Padycosmos
Solution Sage
Solution Sage

You may please try the following:

Rank = RANKX(ALLSELECTED([Ano]), [Total das Vendas],,DESC,DENSE)

 

If you are using a Matrix visual, this vdeo can help:

https://www.youtube.com/watch?v=y2FFjfRD-Bo

I try, but not working, all values are 1.

fabiojoa
Helper I
Helper I

Thank you, but this video does not answer my problem. What happens is that I need the general ranking, where each month was over the three years, and a second ranking to know the position of the month within the year selected by the user.

Padycosmos
Solution Sage
Solution Sage

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.