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
ThomasDHanson
New Member

Divide returning a result the wrong way round... 51% instead of 49%, 60% instead of 40% etc...

I'm dividing gross profit by turnover, to calculate margin %. When I expect to see 49% I see 51%, 40% I get 60%.

 

I've tried two ways - I've created two quick measures with a filtered value for both turnover and gross profit, and then a third quick measure to divide one by the other.

 

I've tried copying the table twice and deleting everything from each to leave turnover in one, and gross profit in the other, linked the tables with a relationship, and then created a quick measure to divide gross profit by turnover. Still, the same result. 

 

I click on the measure and then modelling % to format the result correctly, but can't figure out how to show the proper side of the divide. And switching the divide around (turnover divided by gross profit) didn't work either!

 

My DAX looks like this, when utilising the separate tables: 

GP % =
DIVIDE(SUM('£ GP'[Value]), SUM('£ Turnover'[Value]))
 
and this when dividing the measures:
£ GP % =
DIVIDE([£ GP], [£ Turnover])
 
Please can you help? 
 
Divide.JPG
2 REPLIES 2
dax
Community Support
Community Support

Hi @ThomasDHanson , 

I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
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.

It was an error with the spreadsheet... It was due to adding a row in a spreadsheet that was being linked to, which then changed the values for power bi. Because the row being picked up was cost of sales, this gave the opposite to gross profit. Quite obscure, but everything was correct in power bi. Testing a 'clean' example with sample data (in prep to upload for help!) was the key - and something I'd recommend to all! Thanks for the reply and help.

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.