Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Percentage Difference for a single row

Hi there,   I have a table that contains 3 rows.   Is there a way I can show rows 2 & 3 as percentage differences from row 1?   Thanks,   JAson
  • v-frfei-msft's avatar
    7 years ago

    Hi Anonymous,

     

    Create the measures as below.

     

    Measure = CALCULATE(SUM(Table1[t1]))
    rank = RANKX(ALL(Table1),[Measure])
    perc = var onerow = CALCULATE(SUM(Table1[t1]),FILTER(Table1,[rank]=3))
    var restrow = CALCULATE(SUM(Table1[t1]),FILTER(Table1,[rank]<>3))
    return 
    restrow/onerow

     

    For more details, please check the pbix as attached.

     

    Regards,

    Frank