Forum Discussion
ki
5 years agoFrequent Visitor
Creating a Measure Based on 2 Tables
Hello, Trying to create a measure that shows revenue for specific product category as percentage of total revenue. Below are the 2 tales. This is of course easily achievable by creating a relatio...
- Anonymous5 years ago
Hi ki ,
So category A should be 12/(12+6+23+12+45+12) = 10.9%? If so, you will need to modify the measure as below.
Measure = var total_rev = CALCULATE(SUM(Table1[revenue]),ALL(Table1)) var pro_rev = CALCULATE(SUM(Table1[revenue]),FILTER(ALL(Table1),Table1[product] in VALUES(Table2[product]))) return pro_rev/total_revBest Regards,
Jay
ki
5 years agoFrequent Visitor
Thanks, the 43% wasj ust an example of what I want to get.
Anonymous
5 years agoNot applicable
Hi ki ,
So category A should be 12/(12+6+23+12+45+12) = 10.9%? If so, you will need to modify the measure as below.
Measure =
var total_rev = CALCULATE(SUM(Table1[revenue]),ALL(Table1))
var pro_rev = CALCULATE(SUM(Table1[revenue]),FILTER(ALL(Table1),Table1[product] in VALUES(Table2[product])))
return
pro_rev/total_rev
Best Regards,
Jay