Forum Discussion

wangjuan303's avatar
wangjuan303
Icon for Helper III rankHelper III
4 years ago
Solved

How to compare different type in Metric

Hi Team, I have report like this, user will from slicer pick two type, and compare the different, 

I can get all related data from report, But not sure how to get different value . 

for example, here I need add one more column call " Diff", 

this one should show veriance between "Internal" and "on Sale" 

Thank you for help

 

  • wangjuan303 , One way is to use min and max

     

    measure =
    var _min = minx(allselected(Type), Type[Type])
    var _max = maxx(allselected(Type), Type[Type])
    return
    calculate(sum(Table[Value]), filter(Type, Type[Type] = _max)) - calculate(sum(Table[Value]), filter(Type, Type[Type] = _min))

     

    Compare Categorical Data Using Slicers - Compare two Brands: https://youtu.be/exN4nTewgbc

1 Reply

  • wangjuan303 , One way is to use min and max

     

    measure =
    var _min = minx(allselected(Type), Type[Type])
    var _max = maxx(allselected(Type), Type[Type])
    return
    calculate(sum(Table[Value]), filter(Type, Type[Type] = _max)) - calculate(sum(Table[Value]), filter(Type, Type[Type] = _min))

     

    Compare Categorical Data Using Slicers - Compare two Brands: https://youtu.be/exN4nTewgbc