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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Kira_Net
Helper I
Helper I

How to calculate the percent of contribution to the total (Percent to total)

Hi there,
I wanted to create a matrix visualization which has a client field on the Row, Ship A, Ship B, Ship C and Ship D on the Values. My problem is my table looks as follows. I need to create a percent to total for all shipping methods to put them as individual fields on the values section. Can somebody help me please?

 

Client Shipping MethodPacked Date
ABCShip A03/22/2021
XYZShip D04/22/2021
ABCShip A03/27/2021
XYZShip C07/12/2021
XYZShip B05/23/2021
ABCShip C01/19/2022
1 ACCEPTED SOLUTION

Hi @Kira_Net 

"But I need how many percent of product XYZ shipped by Ship A, Ship B, Ship C and Ship D" 

in this scenario, you can try this 

Percentage = 
var _countPermethod= CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'), 'Table'[Client]=MIN('Table'[Client]) && 'Table'[Shipping Method]=MIN('Table'[Shipping Method])))
var _countTotalmethod= CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Client]=MIN('Table'[Client])))
return 
DIVIDE (
    _countPermethod,
    _countTotalmethod
)

vxiaotang_0-1652258213327.png

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Kira_Net , A measure like

 

divide(count(Table[Shipping Method]) , calculate(count(Table[Shipping Method]) , allselected()) )

 

or

 

divide(count(Table[Shipping Method]) , calculate(count(Table[Shipping Method]) , all()) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thank you. But this only gives me the percent to total for all shipping method. But I need how many percent of product XYZ shipped by Ship A, Ship B, Ship C and Ship D?

 

Hi @Kira_Net 

"But I need how many percent of product XYZ shipped by Ship A, Ship B, Ship C and Ship D" 

in this scenario, you can try this 

Percentage = 
var _countPermethod= CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'), 'Table'[Client]=MIN('Table'[Client]) && 'Table'[Shipping Method]=MIN('Table'[Shipping Method])))
var _countTotalmethod= CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Client]=MIN('Table'[Client])))
return 
DIVIDE (
    _countPermethod,
    _countTotalmethod
)

vxiaotang_0-1652258213327.png

 

Best Regards,

Community Support Team _Tang

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.