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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

IF statement in dax

Hello!!

I have a question about IF en DAX, I hope someone  could helpme

 

I have this values

10000

345.67

897.01

100

750

783

321.45

890.5

0

etc

 

I want to check if the number afther the . (dot) is 00 and im trying with this,

 

Value.00 = IF(MOD('MyTable'[TOTAL],SIGN('MyTable'[TOTAL))=00,1,0)

 

but I have this error:

Division by zero has occurred when evaluating function 'MOD'.

 

Are not sure what others options can use.

 

Thanks for the help

Mónica

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Mónica,

 

Try this formula, please.

Column =
IF (
    SEARCH ( ".", [Value],, 9999 ) = 9999,
    1,
    IF ( RIGHT ( [Value], 2 ) = "00", 1, 0 )
)

IF_statement_in_dax

 

Best Regards,

Dale

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

View solution in original post

6 REPLIES 6
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Mónica,

 

Try this formula, please.

Column =
IF (
    SEARCH ( ".", [Value],, 9999 ) = 9999,
    1,
    IF ( RIGHT ( [Value], 2 ) = "00", 1, 0 )
)

IF_statement_in_dax

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

HI @v-jiascu-msft

 

Thanks for your help!!

It works perfect

 

Greetings 

Mónica

Anonymous
Not applicable

Hi @Anonymous

 

Try this:

 

Column = IF(RIGHT(Table[Total,2)="00", 1,0)

 

Thanks
Raj

Anonymous
Not applicable

Hi @Anonymous

 

Thanks for your reply.

 

This option doesnt work for me, because the numbers like

 

1000

750

 dont show the .00 but its has it.

with this opcion only show me the 1000 and the 750 dont show me, but should it.

 

Thanks again

Monica

I'm sure there are lots of ways to do this.

 

You could try the Quotient function like         QUOTIENT(scores[Num1],1) to get the number on the LHS of the decimal point.

Then subtract that number from the original.  If the result is zero then the condition (i.e is it a whole number) is true.

 

I don't know whether you are effectively testing for a whole number or whether you also consider the condition true for numbers like 5.001 

You can change the algorithm slightly to cope with these numbers

Anonymous
Not applicable

I hope your data type is decimal, so if you set the number of decimal to 2, you will have 1000.00, 745.34.And ths formula will work.

 

Please let me know if you see any issues.

 

Thanks

Raj

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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