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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mgiusto
Helper I
Helper I

I can't figure out why 0 doesn't equal 0 in some cases.

I created a two columns in Power Query, one is named Difference which subtracts one value from another to show the difference.

The other is named Matching and that checks Difference to see if the value is 0, if it is the values of Matching should be "Match" if not "No Match".  When I use the Matching field in a slicer and select "No Match" I will see some values of 0.00 in the Difference column appear, why would this occur and how can I correct it?

 

Difference = [InvoiceAmt]-[D365.InvoiceAmt]

Matching = if [Difference] = 0 then "Match" else "No Match"

 

mgiusto_0-1665775301724.png

 

Thank you for any assistance

 

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

Hi @mgiusto ,
I would recommend to apply a rounding with no decimals to your "Difference"-column.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

3 REPLIES 3
mgiusto
Helper I
Helper I

Thank you ImkeF,

 

I actually did this while waiting for a reply. I did a round to 2 decimal places and that fixed this issue!

For dollar value columns,  you probably want to use a Fixed Decimal Number data type. This should make rounding errors less common since it isn't using floating point math.

ImkeF
Super User
Super User

Hi @mgiusto ,
I would recommend to apply a rounding with no decimals to your "Difference"-column.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors