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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Digger
Post Patron
Post Patron

BUG dividing

How stupid PBI can produce this result?


Digger_0-1639427339888.png


Sales = SUM(debsum) - SUM(CredSum)

_F 11 EBITDA = m1 + m2 - m3 // does not matter, take for example 1
_MF 11 EBITDA = DIVIDE([_F 11 EBITDA],[Sales])
6 REPLIES 6
bcdobbs
Community Champion
Community Champion

The problem comes from the total of the sales measure.

 

It's calculating as a tiny value eg 0.00000000000000001 You're then dividing by this and giving the large percentage.

 

How would you expect the sales measure to agregate at the total level? If it's a straight sum of each day you need to do:

Sales = 
SUMX(
   VALUES ( Date[Date] ),
   SUM(debsum) - SUM(CredSum)
)

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

@bcdobbs  i also thought like that, but i did a test,
Measure = [Sales] > 0  Result: False

Measure = [Sales] < 0  Result: True

Measure = [Sales] <-0.000000000000001  Result: True

bcdobbs
Community Champion
Community Champion

What value would you expect the total sales to be and how should it be aggregated?

 

_F 11 EBITDA Is also negative so I think your test further agrees with result you're seeing.

 

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

@bcdobbs  it should be empty, so only one working way is Round([Sales],2)

bcdobbs
Community Champion
Community Champion

Ok!


Chsnge the data type of your Sales measure and the underlying columns to currency. I think you're getting issues from floating point arithmetic.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
bcdobbs
Community Champion
Community Champion

Sorry slight update to the above now I'm at a computer.

Set the data type for columns and measure to fixed decimal:

Data types in Power BI Desktop - Power BI | Microsoft Docs

 

bcdobbs_0-1639469920697.png

Rather than decimal number.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors