Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
DRasmussen
Frequent Visitor

How to calculate sum of rows and overall percentage of sum?

I have the following table where I am trying to calculate the overall compliance (sum of numerator for VBP and NVBP/sum of denominator for VBP and NVBP) for each measure for each group. My table looks like the following:

 

CustomerMemberGroupNameVBP_TypeMeasure DescriptionNumeratorDenominatorCompliance Rate
Group 1NVBPBCS-Breast Cancer Screening284267%
Group 1NVBPCCS-Cervical Cancer Screening14118576%
Group 1NVBPCOL-Colorectal Cancer Screening6512652%
Group 1NVBPW34-Well-Child Visits in the Third, Fourth, Fifth and Sixth Years of Life456965%
Group 1VBPBCS-Breast Cancer Screening262893%
Group 1VBPCCS-Cervical Cancer Screening11713289%
Group 1VBPCOL-Colorectal Cancer Screening405178%
Group 1VBPW34-Well-Child Visits in the Third, Fourth, Fifth and Sixth Years of Life719079%
Group 2NVBPBCS-Breast Cancer Screening517865%
Group 2NVBPCCS-Cervical Cancer Screening8714361%
Group 2NVBPCOL-Colorectal Cancer Screening8319543%
Group 2NVBPW34-Well-Child Visits in the Third, Fourth, Fifth and Sixth Years of Life102343%
Group 2VBPBCS-Breast Cancer Screening151788%
Group 2VBPCCS-Cervical Cancer Screening182282%
Group 2VBPCOL-Colorectal Cancer Screening283874%
Group 2VBPW34-Well-Child Visits in the Third, Fourth, Fifth and Sixth Years of Life11100%
Group 3NVBPBCS-Breast Cancer Screening10815172%
Group 3NVBPCCS-Cervical Cancer Screening21629573%
Group 3NVBPCOL-Colorectal Cancer Screening17126664%
Group 3NVBPW34-Well-Child Visits in the Third, Fourth, Fifth and Sixth Years of Life384879%
Group 3VBPBCS-Breast Cancer Screening485587%
Group 3VBPCCS-Cervical Cancer Screening9411880%
Group 3VBPCOL-Colorectal Cancer Screening8610681%
Group 3VBPW34-Well-Child Visits in the Third, Fourth, Fifth and Sixth Years of Life324473%

 

Would I create a measure or several measures? I am unsure how to perform this calculation for my report. Can someone help?
Thanks so much,

Dea

1 ACCEPTED SOLUTION

hi @DRasmussen 

This is a measure totals problem. Very common. See this post about it
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
For your case, just add a new measure as below:
Measure =
VAR _table =
    SUMMARIZE (
'Table',
        'Table'[CustomerMemberGroupName],
        'Table'[VBP_Type],
        'Table'[Measure Description],
        "_value", [Compliace Rate]
    )
RETURN
    SUMX ( _table, [_value] )
 
Regards,
Lin
 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@DRasmussen is this how your raw data looks like or your numerator and denominator are measure? In the exmaple you gave, for each row seems like you are diving N with D, correct?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi Parry,

 

This is the raw data. The numerators and denominators are not calculated fields or measures.

@DRasmussen seems like this is pretty straight forward until I'm missing something, add following measure

 

Compliace Rate = 
DIVIDE ( SUM ( Table[Numerator] ), SUM ( Table[Denominator ) )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

It seems like we're almost there, except it is providing the compliance rate for all the groups aggregated together instead of by measure for each group. Does something else need to be added to the measure?

hi @DRasmussen 

This is a measure totals problem. Very common. See this post about it
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
For your case, just add a new measure as below:
Measure =
VAR _table =
    SUMMARIZE (
'Table',
        'Table'[CustomerMemberGroupName],
        'Table'[VBP_Type],
        'Table'[Measure Description],
        "_value", [Compliace Rate]
    )
RETURN
    SUMX ( _table, [_value] )
 
Regards,
Lin
 

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.