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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

IF Number Ends With

I have a number field with different data:

 

1.00

1.14

2.00

1.01

 

I want to write a formula that states if the number ends with .00 then "Parent", if not then "Child"

 

My formula below is only returning child. I am guessing it does not like the ".00" with the numbers above. 

 

Parent = IF(RIGHT('DataReader vSalesMaster'[SalesOrderLine], 3)=".00",
"Parent", "Child")

2 ACCEPTED SOLUTIONS
OwenAuger
Super User
Super User

How about this instead:
Parent =
IF ( 'DataReader vSalesMaster'[SalesOrderLine] = TRUNC( 'DataReader vSalesMaster'[SalesOrderLine]), "Parent", "Child")

Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula

 

=IF(MOD('DataReader vSalesMaster'[SalesOrderLine],1)=0,"Parent", "Child")


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

By my tests, it seems that the replies from @Ashish_Mathur and @OwenAuger should be right.

 

If you have solved your problem by the replies, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

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

Both solutions work great! Thank you so much!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula

 

=IF(MOD('DataReader vSalesMaster'[SalesOrderLine],1)=0,"Parent", "Child")


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
OwenAuger
Super User
Super User

How about this instead:
Parent =
IF ( 'DataReader vSalesMaster'[SalesOrderLine] = TRUNC( 'DataReader vSalesMaster'[SalesOrderLine]), "Parent", "Child")

Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.