Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wangjuan303
Helper III
Helper III

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_0-1649211380928.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.