Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Compare Rows

Hi all,   I have the a table called "Plan" which looks like this: ResourceName Date Task Total Capacity Per Month A 1 January, 2022 A 147 A 1 February, 2022 B 147 B 1 March, ...
  • amitchandak's avatar
    4 years ago

    Anonymous ,  You need an index column for that. Add that in power query

    new column in dax

    if( [Index] = minx(filter(Table, [resourcename] = earlier([resourcename]) && [Date] = earlier([date]) ), [Index] ) ,[Total capacity per monnth], 0) 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Thanks for this, but I am having a problem getting the index. I tried:

    Index 1 = RANKX(Plan,Plan[Date],,ASC,Dense)
     
    Grand Index = RANKX (
    Plan,
    Plan[Index 1]
    + RANKX ( Plan, Plan[ResourceName],, ASC, DENSE )
    * MAX ( Plan[Index 1] ),
    ,
    ASC,
    DENSE
    )
    but because I dont have unique names or dates I can get a unique number for each row.