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
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
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.