Forum Discussion

KartikWatt's avatar
KartikWatt
Regular Visitor
2 years ago
Solved

DAX Ranking within Group

Hello PBI Experts I am struggling with a DAX calculation.    I have attached a sample data below for which I expecting following output : * A table with 7 distinct rows with each row representing...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi KartikWatt ,

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

    Create 2 measures.

    Measure =
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Store Name] = SELECTEDVALUE ( 'Table'[Store Name] )
        ),
        'Table'[Revenue]
    )
    
    Measure2 =
    VAR _1 =
        RANKX ( ALL ( 'Table' ), CALCULATE ( [Measure] ),, desc, DENSE )
    RETURN
        IF ( MAX ( 'Table'[weekday] ) = _1, _1, BLANK () )
    

     

     

    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 _ Rongtie

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