Forum Discussion
Calculating Variance between 2 campaigns
Hello,
I would like to create a Power BI dashboard which shows performance in revenue between 2 campaigns. The campaigns are determined by 3 slicers - Strategy, Country and Collection and the values for these slicers changes every month. For example campaign 1 could be a 'Conversion' Strategy, 'USA' as the Country and 'Happy Days' as Collection while campaign 2 could be 'Brand' as Strategy, 'New Zealand' as Country and 'Relax' as Collection. The end user will select the values for these 3 different slicers for the table visual for campaign 1 and do the same for the table visual in campaign 2. I would like to create a 3rd table visual that automatically calculates the variances in revenue based on what the end user selects for these 2 sets of slicers that will determine what is campaign 1 and what is campaign 2. Please advise how I can do this? The mockup is below:
Thanks in advance.
- Anonymous2 years ago
Hi Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table.
Table 2 = 'Table'(3)We can create a measure.
Measure = var _a=CALCULATE(SUM('Table'[Revenue]),ALLSELECTED('Table')) var _b=CALCULATE(SUM('Table 2'[Revenue]),ALLSELECTED('Table 2')) return DIVIDE((_b-_a),_a)(4) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- amitchandakSuper User
Anonymous , for that you need alteast one set of slicers on independent/disconnected tables
Compare Categorical Data Using Slicers - Compare two Brands: https://youtu.be/exN4nTewgbc
- AnonymousNot applicable
Hi Anonymous ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table.
Table 2 = 'Table'(3)We can create a measure.
Measure = var _a=CALCULATE(SUM('Table'[Revenue]),ALLSELECTED('Table')) var _b=CALCULATE(SUM('Table 2'[Revenue]),ALLSELECTED('Table 2')) return DIVIDE((_b-_a),_a)(4) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Awesome, this solution is perfect! Thank you so so much!