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! Learn more

Reply
Anonymous
Not applicable

Dax

zeroissue.png

In the above picture, I want to replace NaN and infinity wth string "Not Applicable". What will be the Dax?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous  ,

Here are the steps you can follow:

1. Create calculated column.

new =
IF(
    [OldResult] in {1/0,0/0},
    "Not Applicable",[OldResult]&"")

 2. Result.

v-yangliu-msft_0-1620291673535.png

 

Best Regards,

Liu Yang

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

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous  ,

Here are the steps you can follow:

1. Create calculated column.

new =
IF(
    [OldResult] in {1/0,0/0},
    "Not Applicable",[OldResult]&"")

 2. Result.

v-yangliu-msft_0-1620291673535.png

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@Anonymous , Prefer to use divide and return blank() ,

 

Divide([Column1], [column2], blank())

 

Because "Not Applicable" is a text and the rest are numbers, the mixed data type is not allowed

 

if([column2] =0, "Not Applicable", [Column1]/[Column2] & "")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

It is possible with if function in Power Query.

Helpful resources

Announcements
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!

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.

Top Solution Authors