Forum Discussion
Using 2 Slicers to Calculate/Display Variance
- Anonymous4 years ago
Hi CoreyLearnsBI ,
I download your pbix file and check it. I think you create two slicers by same [Month/Year] column. We couldn't get two different values from one column. It is better for you to create an unrelated Month/Year table for slicer2.
Month/Year = VALUES('Data for SQL (MY22)'[Month/Year])Then create a measure to achieve your goal.
Display Variance = VAR _sumtable1 = CALCULATE ( SUM ( 'Data for SQL (MY22)'[Metric 1] ) ) VAR _selectmonth = SELECTEDVALUE ( 'Month/Year'[Month/Year] ) VAR _sumtable2 = CALCULATE ( SUM ( 'Data for SQL (MY22)'[Metric 1] ), FILTER ( ALLEXCEPT ( 'Data for SQL (MY22)', 'Data for SQL (MY22)'[Group], 'Data for SQL (MY22)'[Market] ), 'Data for SQL (MY22)'[Month/Year] = _selectmonth ) ) RETURN _sumtable1 - _sumtable2Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
As long as you use disconnected tables for your slicers and measures for your result this will be straightforward.
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
I've added a link to the dataset: https://www.dropbox.com/s/n3rzu68aolp8azo/05.16%20Forum%20Question.pbix?dl=0