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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jocelyn
Helper I
Helper I

iferror in M Language

hi , 

 

i wanted to apply this excel formula to M language. 

 

Iferror (if (Non captive amount.amount <> 0, usd@planrate helpcell2, if( noncaptive amount.amount = 0 , usd@planrate helpcell1. usd@planrate help...

 

how do i change it correctly? 

Thanksusd@plan.PNG

2 ACCEPTED SOLUTIONS
selimovd
Super User
Super User

Hey @Jocelyn ,

 

you didn't close the bracket of the ifs.

Close them and I think it should work.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

v-yalanwu-msft
Community Support
Community Support

Hi, @Jocelyn ;

The conditional format formula of M language is written as follows:

if [Non Captive Amount.amount] <>null then [#"USD@planrate helpce112"]
else if [Non Captive Amount.amount] =null then [#"USD@planrate helpce111"] 
else null

vyalanwumsft_0-1634203726406.png

in addition, here it is recommended that the column name in power Query do not have #"".

vyalanwumsft_1-1634203792859.png

Or you could add conditional column in power query .

vyalanwumsft_2-1634203919985.png

Best Regards,
Community Support Team_ Yalan Wu
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

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @Jocelyn ;

The conditional format formula of M language is written as follows:

if [Non Captive Amount.amount] <>null then [#"USD@planrate helpce112"]
else if [Non Captive Amount.amount] =null then [#"USD@planrate helpce111"] 
else null

vyalanwumsft_0-1634203726406.png

in addition, here it is recommended that the column name in power Query do not have #"".

vyalanwumsft_1-1634203792859.png

Or you could add conditional column in power query .

vyalanwumsft_2-1634203919985.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Jocelyn Parenthesis are unnecessary as is second 'each'.

selimovd
Super User
Super User

Hey @Jocelyn ,

 

you didn't close the bracket of the ifs.

Close them and I think it should work.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

May i know why it will have this "function" here

Supposely, all should be numbers or null. 

fucntion.PNG

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.