Forum Discussion

JamesBurke's avatar
JamesBurke
Helper III
2 years ago
Solved

Rank

Hi All ,    I have a Ranking system :      Rank = VAR _RANK = RANKX(FILTER(ALL('Emporia Devices'[Wawrick Device Name]) , 'Emporia Devices'[Wawrick Device Name] <> BLANK()), [Total solar Genera...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Thank you OwenAuger and SamWiseOwl 

    Hi, JamesBurke 

    Based on your descriptive information, as well as the example data provided and the expected output, I created the following example data:

    I created a measure using this DAX expression below:

    Rank = 
    VAR _rank =
        RANK (
            FILTER (
                ALLSELECTED ( 'Emporia Devices' ),
                'Emporia Devices'[Wawrick Device Name] <> BLANK ()
            ),
            ORDERBY (
                CALCULATE ( SUM ( 'Emporia Devices'[Total Solar Generated] ) ), DESC,
                CALCULATE ( MAX ( 'Emporia Devices'[Store Name] ) ), ASC
            )
        )
    RETURN
        IF (
            SELECTEDVALUE ( 'Emporia Devices'[Wawrick Device Name] ) <> BLANK (),
            _rank,
            BLANK ()
        )
    

    The results are as follows:

    I have provided the PBIX file used in this instance below.

     

     

    Best Regards

    Jianpeng Li

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