Forum Discussion

Kmoore15's avatar
Kmoore15
New Member
8 years ago
Solved

DAX Ranking within a group

Hello,   I am new to PowerPivot and am struggling to accompish what I am trying to do. I have a data set and I am trying to identify the total freight cost for all billing documents after the first...
  • Phil_Seamark's avatar
    8 years ago

    HI Kmoore15

     

    You could try adding this DAX column to your model

     

    Rank = CALCULATE(
                    COUNTROWS('Table1'),
                    FILTER(
                        ALL(Table1),
                        'Table1'[Sales document] = EARLIER('Table1'[Sales document]) && 
                        'Table1'[Freight Cost] > EARLIER('Table1'[Freight Cost])
                        )
                        )+1