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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Correct total sum

Hello, 

I am having trouble with a formual its simple just multiplying Total - Actual column by the Target % to give me the Total # per below table in red. The sum however is not working its multiplying the sum of the percentages. 
I have the correct Target column below what its suppose to be.


Can someone help me modify my formula to get the correct sum please?

Target # =
                (SUMX(
                    FILTER(
                            'Data',
                            'Data'[Region] = "Canada"), [Total - Actual])
                            * [Target %]
                            )

 

 

Kryssy_1-1673419867616.png

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Target # = 
IF(HASONEVALUE('Table'[Date]),[Target %]*[Total - Actual],SUMX('Table',[Target %]*[Total - Actual]))

vzhangti_0-1673506417401.png

IF(HASONEVALUE()) can control the output of Total.

Solved: wrong total of measure - Microsoft Power BI Community

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Target # = 
IF(HASONEVALUE('Table'[Date]),[Target %]*[Total - Actual],SUMX('Table',[Target %]*[Total - Actual]))

vzhangti_0-1673506417401.png

IF(HASONEVALUE()) can control the output of Total.

Solved: wrong total of measure - Microsoft Power BI Community

 

Best Regards,

Community Support Team _Charlotte

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

ValtteriN
Super User
Super User

Hi,

This is quite common issue. I recommend reading this article to understand what is going on better: Obtaining accurate totals in DAX - SQLBI

In short the table total is calculating the SUMX with empty filter context. Yo ucan create an if logic based on this like this: 

CustomTotal = IF(isblank(SELECTEDVALUE('Data'[Region])),
(SUMX(
                    FILTER(
                            ALL('Data'),
                            'Data'[Region] = "Canada"), [Total - Actual])
                            * [Target %]
                            )

,[Target #])


Here if the row is total (selected value isblank) then we do the SUMX calculation over the entire table otherwise we use the original logic.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hi @ValtteriN , this works but it only gives me the total columns how do I get it to give me the numbers and total in the same column please? I wanted it to be like the Correct Target Column in green, please?

Kryssy_0-1673440343029.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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