Forum Discussion
k123
8 years agoFrequent Visitor
How to divide a column value by a measure?
Hi, I am trying to create some measures in power bi, where I want to divide each score by the sum of scores for each group My data looks like following: I created a meaure to get su...
- 8 years ago
k123,
You may refer to the measure below.
Measure = DIVIDE ( SUM ( Table1[score] ), CALCULATE ( SUM ( Table1[score] ), ALLSELECTED ( Table1[category] ) ) )
Anonymous
8 years agoNot applicable
I'm thinking you're looking for a result like this, comparing each value to the total value of that group. You can leverage ALL and EARLIER to get the right context:
Percentage of Group Total =
DIVIDE(Data[Score],
CALCULATE(
SUM(Data[Score]),
FILTER(Data, Data[Group] = EARLIER(Data[Group]))), 0)
k123
8 years agoFrequent Visitor
Anonymous Is there a way to create a measure instead of a column, like in your solution?
- v-chuncz-msft8 years ago
Community Support
k123,
You may refer to the measure below.
Measure = DIVIDE ( SUM ( Table1[score] ), CALCULATE ( SUM ( Table1[score] ), ALLSELECTED ( Table1[category] ) ) )