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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Bali21
Frequent Visitor

Dynamic % of row total

Hi All,

 

I have a Matrix, where Country and city as column and Business group(BG) and function as rows. I want to calculate the percentage of row total for country wise and If I expand to city then By city wise. Simillarly first @ BG wise and If I expand my rows to function, Then function wise.

Please seethe screen shot for refeence:

Bali21_0-1688045875613.png

 

For example under COO for ops I should get another two column, TR (%)_People = 42% & NY (%)_People = 58%. Basically  for each row it should take row total as denominator and given value as numerator for percenatge calculation.

Also when I contract for city to country Then  above calculation should also change.

 

Data source Sceen shot:

BGFunctionCountry CityNumber of People
COOopsUSNY4
COOopsCANTR3
COOServiceUSCL6
HRopsUSNY1
HRPaymentCANON3
FinanceopsUSMN3
FinanceServiceCANTR6
FinanceServiceCANTR8
FinancePaymentUSSF2

 

Thanks in Advance!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Bali21 

the following measures can be considered

Measure = SWITCH(TRUE(),ISINSCOPE('Table'[Function])&&ISINSCOPE('Table'[City]),DIVIDE(SUM('Table'[Number of People]),CALCULATE(SUM('Table'[Number of People]),ALLEXCEPT('Table','Table'[BG],'Table'[Country ],'Table'[Function]))),ISINSCOPE('Table'[Function]),DIVIDE(SUM('Table'[Number of People]),CALCULATE(SUM('Table'[Number of People]),ALLEXCEPT('Table','Table'[BG],'Table'[Function]))),ISINSCOPE('Table'[City]),DIVIDE(SUM('Table'[Number of People]),CALCULATE(SUM('Table'[Number of People]),ALLEXCEPT('Table','Table'[BG],'Table'[Country ]))),SUM('Table'[Number of People]))

Output

vxinruzhumsft_0-1688353787755.png

vxinruzhumsft_1-1688353830030.png

Best Regards!

Yolo Zhu

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

1 REPLY 1
Anonymous
Not applicable

Hi @Bali21 

the following measures can be considered

Measure = SWITCH(TRUE(),ISINSCOPE('Table'[Function])&&ISINSCOPE('Table'[City]),DIVIDE(SUM('Table'[Number of People]),CALCULATE(SUM('Table'[Number of People]),ALLEXCEPT('Table','Table'[BG],'Table'[Country ],'Table'[Function]))),ISINSCOPE('Table'[Function]),DIVIDE(SUM('Table'[Number of People]),CALCULATE(SUM('Table'[Number of People]),ALLEXCEPT('Table','Table'[BG],'Table'[Function]))),ISINSCOPE('Table'[City]),DIVIDE(SUM('Table'[Number of People]),CALCULATE(SUM('Table'[Number of People]),ALLEXCEPT('Table','Table'[BG],'Table'[Country ]))),SUM('Table'[Number of People]))

Output

vxinruzhumsft_0-1688353787755.png

vxinruzhumsft_1-1688353830030.png

Best Regards!

Yolo Zhu

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

 

 

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.