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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Subtract two tables values based on two different slicer values

We've a requirement to display the difference of two measure fields. Shared example for your reference :

 

pranay2k2_1-1726070071883.png

Your cooperation in this regard will be highly appreaciated. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _selecttable2=SELECTEDVALUE('Table2'[Month])
var _sumtable2=SUMX(
    FILTER(ALL('Table2'),'Table2'[Month]=_selecttable2&&'Table2'[Client]=MAX('Table1'[Client ID])),[Sales])
return
SUM('Table1'[Sales]) - _sumtable2

2. Result:

vyangliumsft_0-1726104413184.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for providing quick solution. Implemented this logic and it worked as expected.

Anonymous
Not applicable

Hi  @Anonymous ,

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _selecttable2=SELECTEDVALUE('Table2'[Month])
var _sumtable2=SUMX(
    FILTER(ALL('Table2'),'Table2'[Month]=_selecttable2&&'Table2'[Client]=MAX('Table1'[Client ID])),[Sales])
return
SUM('Table1'[Sales]) - _sumtable2

2. Result:

vyangliumsft_0-1726104413184.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.