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

How to subtract 2 measures which depends on 2 different date slicers

Hi Experts,

 

I am having an issue while substracting 2 measures. Below are my scnerios

1. I am having 2 month filters

2. First month filter will be applied to first visual and will get the data for selected month and next 2 months

3. Second month filter will be applied to another visual and will get the data for selected month and next 2 months for second prompt.

4. I need to display third visual which will show the differene of above 2 visuals monthwise.

 

Lets say, in first month prompt, i have selected Jan-2019, so it will display the data for Jan-19, Feb-19 and Mar-19

in second month prompt, i have selected Jan-2018, so it will display the data for Jan-18, Feb-18 and Mar-18

 

I need to show the difference [Jan-19]-[Jan-18], [Feb-19]-[Feb-18], [Mar-19]-[Mar-18] in another visual.

 

Hope i have explained what i want. Attaching the PBIX file as well for reference.PBIX File in zip

 

Thanks for your help.

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

Change the Visual interactions to cross-filter and use measure below.

Difference 1 =
CALCULATE ( [ID rolling average1], ALL ( 'Table'[Month_Year] ) )
    - CALCULATE ( [ID rolling average 2nd 1], ALL ( daydate[Month_Year] ) )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-chuncz-msft 

 

This works for me. One more question, can we make this more dynamically. I mean, instead of selecting month_year for slicer 1 and 2, i will select a date range..lets say for first slicer...01/01/2019 - 30/05/2019 and for second slicer...01/04/2018 - 31/08/2018...Now first 2 visual should show 5 months data and third visual should show differen for all 5 months. Can we achieve this using a single measure ?

 

Early help will be highly appreciated.

 

Thanks,

Sunil

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.