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
Anno2019
Helper IV
Helper IV

row calculations not correct

Hi PowerBI Guru's

I am having trouble with getting my row-level totals to be correct.  It seems simple enough but I cannot win.

I have a measure:

Additional Oranges required = 

IF(Sales[Pipeline vs Target]/Sales[Hitrate]<=0, 0, Sales[Pipeline vs Target]/Sales[Hitrate])
 
As an example, in my first row, the value for Sales[Pipeline vs Target] is 1,454 and the value for Sales[Hitrate] is 2%.
The expected result should be 72,700 but I keep getting a total of 96,276.
 
 
I have tried creating a column instead of a measure.  I have played around with calculate instead of IF but with no luck.
 
1 ACCEPTED SOLUTION

@selimovd 

I tried SUMX, it just does not work.

I have been playing around and noticed something.

If I bring my data in as one table, do the calculations then it works.  But in my working pbix I bring in the two product data I need and append them into a final file.  it is in the final file that the calculation will not work.  Do you think it has anything to do with how the data is brought in?

 

View solution in original post

5 REPLIES 5
selimovd
Super User
Super User

Hey @Anno2019 ,

 

can you show the table and the measure?

Otherwise you could try as a measure:

Adiitional Oranges required = SUMX(Sales, Sales[Pipeline vs Target] / Sales[Hitrate])

 

Best regards

Denis

@selimovd 

I tried SUMX, it just does not work.

I have been playing around and noticed something.

If I bring my data in as one table, do the calculations then it works.  But in my working pbix I bring in the two product data I need and append them into a final file.  it is in the final file that the calculation will not work.  Do you think it has anything to do with how the data is brought in?

 

Hey @Anno2019 ,

 

it's hard to say anything if you don't show us something.

Why the SUMX didn't work? Did you get an error message? Can you show a screenshot?

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

@selimovd 

My apologies, it worked, I was applying it incorrectly.

 

Hey @Anno2019 ,

 

I'm happy it works 😊

Can you please mark the answer with the SUMX formula additionally as solution? Like this the next person who stumbles across the post can see immediately what worked for that problem.

 

Thank you and best regards

Denis

 

Blog: WhatTheFact.bi

Follow me: twitter.com/DenSelimovic

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.