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
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
Super User
Super User

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

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)

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!!

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
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.