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
sakshikaul
Helper III
Helper III

nested if condition

Hi,

I want in following DAX when denominator is 0 and numerator is some value I am getting result as infinity so I want instead of infinity I should get value as blank or -

Please help

sakshikaul_0-1615894744182.png

GP Yeild KG = var prodA=if(CALCULATE(round(Sum(DBALLSTAT[Profit]),0))/CALCULATE(round(Sum(DBALLSTAT[ChglWt(KG)]),0), Group_Logic[Mode_group_3]="AIR"),if( CALCULATE(round(Sum(DBALLSTAT[Profit]),0))/CALCULATE(round(Sum(DBALLSTAT[Tues]),0)+CALCULATE(sum(DBALLSTAT[CBM])/25), Group_Logic[Mode_group_3]="OCEAN"),CALCULATE(round(Sum(DBALLSTAT[Profit]),0))/CALCULATE(round(Sum(DBALLSTAT[ChglWt(KG)]),0))))return prodA

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @sakshikaul,

 

You can try this in your measure:

if(Denominator=0,blank(),Molecular/Denominator)

 

Best Regards,

Link

View solution in original post

6 REPLIES 6
v-xulin-mstf
Community Support
Community Support

Hi @sakshikaul,

 

You can try this in your measure:

if(Denominator=0,blank(),Molecular/Denominator)

 

Best Regards,

Link

amitchandak
Super User
Super User

@sakshikaul , use divide function

 

example

divide(sum(Table[col]), sum(Table[Col2]))

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

This will not resolve my purpose as I want for eg - 7/0 = infinity , instead of infinity I want result should be Blank 

@sakshikaul , I tried

 

Measure = divide(7,0)

 

 

and it gives a blank. Means you will blank in place of infinity 

 

if you need 0 then try

 

Measure = divide(7,0,0)

means
Measure = divide([measure1],[Measure2],0)

 

 

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

Hi,

I am getting following error. Please help 

sakshikaul_0-1615897663429.png

 

Hi,

I need below expression to work but its not working.

GP Yeild KG = var prodA=CALCULATE(Sum(DBALLSTAT[Profit]))/CALCULATE(Sum(DBALLSTAT[ChglWt(KG)]),Group_Logic[Mode_group_3]="AIR") var prodB=CALCULATE(Sum(DBALLSTAT[Profit]))/CALCULATE(Sum(DBALLSTAT[Tues]),Group_Logic[Mode_group_3]="OCEAN") var ProdC=CALCULATE(Sum(DBALLSTAT[Profit]))/CALCULATE(Sum(DBALLSTAT[ChglWt(KG)])) var ProdD=divide(prodA,prodB,ProdC) return ProdD

 

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