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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

PROBLEM: Trying to addition on a conditonal column

Hey all,

 

So I have a dashboard which looks at a spend per client.

 

Now I have mad a conditional column because some clients have an additional charge, and then I do a measure.

Total Charge = SUM('Billing'[Margin]) + SUM('Billing'[Charge])

 

Now what I have is that all clients total charge comes out as it should, but one clients total is way higher than it should be, and I have found out that it's because that client is appearing three times in the table, and then has three values added against them so instead of their margin been 950 it's 2,850.


Now my question is, is there a way I can do a measure or something to only tell PowerBi to look at the one figure and not add up every margin agaist that client? because it will always be 950

 

 

1 ACCEPTED SOLUTION

If it could change, the way I would do it is to break the table into two. One for transactions (charges) and one for characteristics (clients and margin). Then join the two by client or other unique key and viola!

 

Capture3.PNG

 

Capture2.PNG

Capture.PNG

 

The calculate could be adjusted to account for things like varying margin based on time period etc.

 

 

View solution in original post

5 REPLIES 5
Aron_Moore
Solution Specialist
Solution Specialist

You have any dummy/sample data to share?

 

I imagine it looks like this, but could be way off base. Client d is your offender:

ClientMarginCharge
a100700
b200150
c300100
d950200
d950300

 

Do none of the other Clients have repeating rows?

Anonymous
Not applicable

And no other client has repeating rows who have a margin. But it could be an issue in future months, so I need some sort of calc that only grabs the one margin no matter how many rows?

If it could change, the way I would do it is to break the table into two. One for transactions (charges) and one for characteristics (clients and margin). Then join the two by client or other unique key and viola!

 

Capture3.PNG

 

Capture2.PNG

Capture.PNG

 

The calculate could be adjusted to account for things like varying margin based on time period etc.

 

 

Anonymous
Not applicable

Your example is spot on, so when I tell it to add the margin and add the cost onto that is grabs both margins, and I just want the one.

And there is only the one client that appears more than once? All others are unique?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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