Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 sum of scores by each group, the measure formula used:
Sum by Group = SUMX(VALUES('Table'[group]), CALCULATE( SUM('Table'[score])))
Now I want to create a measure to divide each score in the score column by its corresponding 'Sum by Group' .
Please let me know. Thanks!
Solved! Go to Solution.
You may refer to the measure below.
Measure = DIVIDE ( SUM ( Table1[score] ), CALCULATE ( SUM ( Table1[score] ), ALLSELECTED ( Table1[category] ) ) )
you can try
divide(SUM ( Table1[score]),calculate(SUM ( Table1[score]),ALLEXCEPT(TABLE1,Table1[category])))
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)
@Anonymous Is there a way to create a measure instead of a column, like in your solution?
You may refer to the measure below.
Measure = DIVIDE ( SUM ( Table1[score] ), CALCULATE ( SUM ( Table1[score] ), ALLSELECTED ( Table1[category] ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |