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
Anonymous
Not applicable

Help with calculating accumulative %

hello

 

I need help calculating a %.

 

The blue bar is the sum of several months of a company's total taxes paid and also I have the total of the income of the same months.

gabymachado15_1-1716413366781.png

gabymachado15_3-1716413511626.png

 

 

The percentage I want to calculate is how much that sum of months (say January, February, March, April) represents over the total income of that same month. use the formula
%overincome = SUMX(ZBAL,DIVIDE([total taxes],[income],0)). and it calculates it well for me, but it is calculated monthly, not accumulated. The error that is occurring is that it adds the % of total taxes/income. and the correct thing is to take the total taxes and divide it by income, not simply add the percentages from all months. What can be the DAX for this?

 

The correct answer would be 1.244.205  (total tax)/ 172.400.000 (total income) = 7,2%.. and the answer in my wrong PBI is 5.09 (the sum of all the % of the months)

 

gabymachado15_2-1716413425912.png

 

 

1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @Anonymous 

 

You can try changing the formula to the following.

% = DIVIDE([total tax], [income], 0)

 

Here is a simple test I did:

 

My sample:

vxuxinyimsft_0-1716429387113.png

 

Based on your screenshots, it looks like your total tax and total income are both measures, so I created two measures as well.

total tax = SUM('Table'[TAX])
total income = SUM('Table'[INCOME])

 

Output:

vxuxinyimsft_2-1716429719454.png

 

If the problem persists, please provide sample data and the expected result based on sample data so that I can better help you. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show it as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

2 REPLIES 2
v-xuxinyi-msft
Community Support
Community Support

Hi @Anonymous 

 

You can try changing the formula to the following.

% = DIVIDE([total tax], [income], 0)

 

Here is a simple test I did:

 

My sample:

vxuxinyimsft_0-1716429387113.png

 

Based on your screenshots, it looks like your total tax and total income are both measures, so I created two measures as well.

total tax = SUM('Table'[TAX])
total income = SUM('Table'[INCOME])

 

Output:

vxuxinyimsft_2-1716429719454.png

 

If the problem persists, please provide sample data and the expected result based on sample data so that I can better help you. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show it as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

Anonymous
Not applicable

Thank you so much! It worked. Thank you for your kidness

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.