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
AndresSalomon
Helper II
Helper II

RANKX weird behaviour

Hi all, hope you are doing good. I started using the RANKX function but I'm having a strange scenario that my limited knowledge of DAX cannot explain. 

 

Here is the file in Google Drive (let me know if you can download it): 

Link to report

 

The problem is with the measure [Rank overall]. Is not showing the overall rank starting from 1. It is starting from another number. I need it to start from 1, then 2, 3, etc.. based on the measure [IPK] to rank.

 

The measure [Rank by subcategory] works perfectly. Smiley Happy

 

[Rank overall] = Rank overall = RANKX( ALL(IPKR);
CALCULATE([IPK]); ; DESC; Skip)

Any doubt please let me know. Thank you very much in advance!

 

Kind regards,

Andy

 

1 ACCEPTED SOLUTION

Hi @AndresSalomon

Modify the measure [IPK], [Rank overall]

IPK2 =
DIVIDE (
    CALCULATE ( SUM ( IPKR[Pasajeros] )ALLEXCEPT ( IPKR, IPKR[Ramal] ) ),
    CALCULATE ( SUM ( IPKR[Kilómetros] )ALLEXCEPT ( IPKR, IPKR[Ramal] ) ),
    0
)


Rank overall = RANKX(
ALLSELECTED(IPKR),
IPKR[IPK2], , DESC, Dense
)

1.png

 

Best Regards

Maggie

 

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @AndresSalomon

Where is the measure [Rank overall]? From your pbix, I can't see it.

Does the "Ranking" refer to the measure [Rank overall], if so, what's the matter with the rank number, what is the correct rank, could you give an example?

 

Best Regards

Maggie

Hi Maggie, my bad, I uploaded the wrong file... I fixed the link. Please give it a new try! 

 

Thanks for your help 🙂 

 

Regards,

Andy

Hi @AndresSalomon

Modify the measure [IPK], [Rank overall]

IPK2 =
DIVIDE (
    CALCULATE ( SUM ( IPKR[Pasajeros] )ALLEXCEPT ( IPKR, IPKR[Ramal] ) ),
    CALCULATE ( SUM ( IPKR[Kilómetros] )ALLEXCEPT ( IPKR, IPKR[Ramal] ) ),
    0
)


Rank overall = RANKX(
ALLSELECTED(IPKR),
IPKR[IPK2], , DESC, Dense
)

1.png

 

Best Regards

Maggie

 

Awesome Maggie! @v-juanli-msft

Thank you very much!! Smiley Happy

 

Kind regards,

Andy

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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