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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.