Forum Discussion
How to divide two different values on two different tables, by the related value on both tables?
- Anonymous6 years ago
Try create this measure in Table 1:Result = var sumbycolor = CALCULATE(SUM(Table1[Size]),ALLEXCEPT(Table1,Table1[Color])) var staffno = CALCULATE(SUM('Table2'[Staff]),FILTER(Table1,Table1[Color]=RELATED(Table2[Color]))) Return DIVIDE(sumbycolor,staffno)
Best,
Paul
try to change ";"to ","
it should be a system locale issue
do not hesitate to give a kudo to useful posts and mark solutions as solution
that seemed to have worked! but then now i get this error. sorry, i'm a beginner in terms of Power BI formulas
A function 'SELECTEDVALUE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
- az386 years ago
Community Champion
ok bwanRPD
try
Measure = DIVIDE( SELECTEDVALUE('Table 1'[size]), CALCULATE(SUM('Table 2'[Staff]),Filter('Table 2','Table 2'[Color]=SELECTEDVALUE('Table 1'[Color]))) )do not hesitate to give a kudo to useful posts and mark solutions as solution
- bwanRPD6 years agoFrequent Visitor
Syntax is correct but it's not showing any values.
I want to be able to pull this new measure into the values section of a Matrix visualization, and it would give me the calculated field of the sum of the size of table 1 divided by the staff of table 2, by color.
Thanks for all the help so far!