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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mwaltercpa
Advocate III
Advocate III

DAX Calculated colum, IF > Statement, returns ties?

Today I had two columns:

1. A calculated unit price column in my Sales table.

2. A related column from our price list, returns retail unit prices

 

We needed a third column to flag when the price paid was greater than the retail unit price.

 

3. If(Unit Price > Retail price, "Flag", Blank())

 

What I got was the price paid that were greater than retail, but also all the instances where Price Paid=Retail??

 

I had to add $.01 to the retail price in order to break the tie and get the flag filter to work.

3 REPLIES 3
mwaltercpa
Advocate III
Advocate III

Please see attached,  I have gone out to the max of 15 places, and do not see a difference in these two numbers.

 

Is it possible there is a variance beyond 15 places I can't see limited to 15 places?

Flag.jpgFlag2.jpgFlag3.jpg

@mwaltercpa

 

Based on my test, the maximum of decimal places in PBI Desktop is 15. If you data source number has more than 15 decimal places, it may be rounded.

 

Best Regards,

Herbert

v-haibl-msft
Employee
Employee

@mwaltercpa

 

Not sure what are your tables like. I just tested with following two simple tables.

DAX Calculated colum, IF Statement, returns ties_1.jpg

 

I create a calculated column with following DAX formula.

Column =
IF ( Sales[unit price] > RELATED ( Price[retail unit prices] ), "Flag" )

DAX Calculated colum, IF Statement, returns ties_2.jpg

 

Best Regards,

Herbert

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.