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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
aditya_kamdi
Frequent Visitor

Calculating Percentages of Totals and Row level correctly

I have been trying to calculate the percentage for Sales achieved in " Target%". However, I can either get the percentages to calculate accurately either at every row-level or at the grand total correctly.

I have two values 'Net Sales This Year'[Net Amount] and 'Project Details'[Hong Kong Target Calculation.amount] and the Percentage can be obtained by dividing  'Net Sales This Year' with [Hong Kong Target Calculation.amount]. There are 2 summary levels one is project and other is a state. 

If I use RELATED I get it right at Project Level i.e the lowest level of summary and not at the state and grand total level 

Formula: 

Target % = DIVIDE('Net Sales This Year'[Net Amount], RELATED('Project Details'[Hong Kong Target Calculation.amount]), 0 )

 

tempsnip 2.png

 

If I use SUMX I get the Grand Total right but the summary levels are just wrong

Formula: 

Target % =

DIVIDE('Net Sales This Year'[Net Amount], SUMX('Project Details','Project Details'[Hong Kong Target Calculation.amount]), 0 )

 

tempsnip.png

 

 

 

 

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi aditya_kamdi,

It seems that you use calculated column in Matrix, right? I am not sure your data structure, you could try to use measure like below

SUM('Table'[amount])/SUM(t2[target])

to see whether it work or not. In addition, if your data structure is not similar to my and the measure doesn't work, please inform me more detailed information(such as your sample data and your expected output)? Then I will help you more correctly.

Best Regards,
Zoe Zhi

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
dax
Community Support
Community Support

Hi aditya_kamdi,

It seems that you use calculated column in Matrix, right? I am not sure your data structure, you could try to use measure like below

SUM('Table'[amount])/SUM(t2[target])

to see whether it work or not. In addition, if your data structure is not similar to my and the measure doesn't work, please inform me more detailed information(such as your sample data and your expected output)? Then I will help you more correctly.

Best Regards,
Zoe Zhi

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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