Forum Discussion

AndresSalomon's avatar
AndresSalomon
Helper II
8 years ago
Solved

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 kn...
  • v-juanli-msft's avatar
    v-juanli-msft
    8 years ago

    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
    )

     

    Best Regards

    Maggie