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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
dusdau
Helper II
Helper II

Strange % result

Hi All,

 

I am trying to determine why I am getting a certain result with my measures.  I cannot make sense of it and am certain I am missing something very basic but for the life of me I can't figure out what it is!

 

Here is the table with results:

Screenshot 2022-01-21 122041.png

 

I am trying to determine how it is coming up with that huge percentage for Gross Profit %.

 

Model/Columns/Measures in the table are setup as follows:

Sales[USD Sales Fixed Curr] (column)

Sales[USD Cost Fixed Curr] (column)

USD GP Fixed Curr = Sales[USD Sales Fixed Curr] - Sales[USD Cost Fixed Curr]  (calculated column)
Total Sales (USD Fixed) = SUM Sales[USD Sales Fixed Curr] ) (measure)
Total Cost (USD Fixed) = SUM Sales[USD Cost Fixed Curr] ) (measure)
Total Gross Profit (USD Fixed) = [Total Sales (USD Fixed)] - [Total Cost (USD Fixed)] (measure)
Gross Profit % = DIVIDE [Total Gross Profit (USD Fixed)][Total Sales (USD Fixed)] ) (measure)
 
I've looked for small decimals in the amounts but as far as I can tell the Gross Profit % here should be 0.
 
What am I missing here?
 
1 ACCEPTED SOLUTION

Hi,

The denominator is probably not exactly a 0.  It could be a very small decimal number.  Use the ROUND function in the numerator and denominator to keep only 2 decimal places.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @dusdau 

You can create a calculated column to count the percentage instead of measure .

Column = [Total Gross Profit (USD Fixed)]/[Total Sales (USD Fixed)]

The result is as shown :

Ailsamsft_0-1643079121828.png

Best Regard

Community Support Team _ Ailsa Tao

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

Hi Ailsa,

 

Thanks, but a sum of the individual %'s is not what I am looking for here.  I'm looking to understand why 

DIVIDE [Total Gross Profit (USD Fixed)][Total Sales (USD Fixed)], 0) 

 

Is evaluating to a huge percentage on the aggregate/total line....when it seems like 1.24 divided by 0 should be 0.

Hi,

The denominator is probably not exactly a 0.  It could be a very small decimal number.  Use the ROUND function in the numerator and denominator to keep only 2 decimal places.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Wow, it was so small i could not see the decimal place even when expanding the decimals out.  Putting a ROUND on it confirmed this...and I feel like an idiot now. 🙂  Thanks for the help.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ALLUREAN
Solution Sage
Solution Sage

You are dividing by 0 and this functions should work well, try this:

Gross Profit % = DIVIDE [Total Gross Profit (USD Fixed)][Total Sales (USD Fixed)] ,0)




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Thanks Allurean, I've tried that previously and same result unfortunately.  I think the DIVIDE function defaults to zero if you don't specify that 3rd parameter.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors