Forum Discussion
Have a chart that compares two values from a breakdown
Hi RogerSteinberg ,
You need to create 4 new tables and use the columns as slicers. I create a simple sample that you could reference to modify your report based on the actual requirement.
- Create new tables based on the values that need to be filtered
Note : There are no relatinships among the tables.
- Create measures
_Country = CALCULATE(SUM('Table'[pop]),FILTER('Table','Table'[breakdown] = "Country"))
Country 1 =
var selectedvalue = SELECTEDVALUE('Country Value 1'[Value1])
var _value = CALCULATE(SUM('Table'[pop]),FILTER('Table','Table'[value] = selectedvalue))
return
IF(ISFILTERED('Country Value 1'[Value1]),_value,[_Country])
Country 2 =
var selectedvalue = SELECTEDVALUE('Country Value 2'[Value2])
var _value = CALCULATE(SUM('Table'[pop]),FILTER('Table','Table'[value] = selectedvalue))
return
IF(ISFILTERED('Country Value 2'[Value2]),_value,[_Country])
For "Product", the formulas are same as "Country". Please see the attachment to get more details.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- RogerSteinberg6 years ago
Post Patron
But what if i have dozens of breakdowns?
Also, you're providing two graphs , one for product and the other for country which wouldn't be sustainable with various breakdowns. Ideally as the breakdowns are being filtered, the values would change accordingly. Hence, one graph would be sufficient to compare values under a specific filtered breakdown.
I hope this makes it more clear.