Forum Discussion
Anonymous
2 years agoNot applicable
Dynamically Calculate Sums Per Category in Measure
Hello! I have a calculation that needs to do this: SUM(User Category A) * SUM(Values Category A) + SUM(User Category B) * SUM(Values Category B) + SUM(User Category C) * SUM(Values Category ...
- 2 years ago
I'm confused. Are you sure you are not overthinking this?
Did you have a look at the [Sales Amount] measure example and apply it to your use case?
If you did, can you show me what the results are and why it's not suitable?
HotChilli
Community Champion
2 years agoI'm confused. Are you sure you are not overthinking this?
Did you have a look at the [Sales Amount] measure example and apply it to your use case?
If you did, can you show me what the results are and why it's not suitable?
Anonymous
2 years agoNot applicable
HotChilli
You were absolutely correct, I was over thinking it. Thanks for the help!
Solved in two measures based off your link:
Percent Times Data = SUM(Test[Percent Users]) * SUM(Test[Data])
Unique Category =
VAR UniqueTable =
ADDCOLUMNS
(
DISTINCT(Test[Category]), "Unique Categories", [Percent Times Data]
)
VAR Result = SUMX(UniqueTable, [Unique Categories])
Return Result