Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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] ) ) )
User | Count |
---|---|
98 | |
76 | |
69 | |
53 | |
27 |