Forum Discussion
anonymous188
8 years agoRegular Visitor
different calculation depending on ID
Hi, I have the following made-up tables: Employee ID Product Sold 111 Banana 112 Apple 112 Kiwi 113 Apple 113 Kiwi 113 Mango Employee ID Role ID 111 ...
- 8 years ago
add a measure
Counts = var cnt = Count(Table1[Product Sold]) return cnt * if(MAX(Table2[Role ID]) = 2,3, 1)
change the table name/column name as it fit in your data model.
parry2k
8 years agoSuper User
add a measure
Counts = var cnt = Count(Table1[Product Sold]) return cnt * if(MAX(Table2[Role ID]) = 2,3, 1)
change the table name/column name as it fit in your data model.
- anonymous1888 years agoRegular Visitor
This solution worked for display purposes, but the SUM is incorrect somehow. Rather than applying the logic based on the Role ID, the resulting value is the sum of every count multiplied by 3.
In other words, this is the resulting sum:
Employee ID Counts 111 1 112 2 113 9 Total 18 Any idea what a fix might be?
- parry2k8 years agoSuper User
change max to sum and see