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 function not working

Hi,

Can someone explain me what's wrong with this formula?

Raksy_0-1623923826519.png

Thanks

 

3 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Anonymous 

If you are creating a measure then, this should

Measure  = 
if ( 
    MAX(table[Due Date]) = "null", "9999", MAX(table[Resolution Date]) - MAX(table[Due Date])
)

work.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

So you are doing it in Power Query, this should work:

Table.AddColumn(#"Colonnes renommées13", "Major", each if [Priority] = "Major" and [Issue Type] = "Bug"  then 1 else 0)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

@Anonymous 

You can add as a column to your table using DAX:

Major = if ( and([Priority] = "Major" ,  [Issue Type] = "Bug" ) , 1 , 0)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@Anonymous 

If you are creating a measure then, this should

Measure  = 
if ( 
    MAX(table[Due Date]) = "null", "9999", MAX(table[Resolution Date]) - MAX(table[Due Date])
)

work.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks @Fowmy 

what about this one?

= Table.AddColumn(#"Colonnes renommées13", "Major", each if( [Priority] = "Major" and [Issue Type] = "Bug" )then 1 else 0)

 

@Anonymous 

You can add as a column to your table using DAX:

Major = if ( and([Priority] = "Major" ,  [Issue Type] = "Bug" ) , 1 , 0)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

So you are doing it in Power Query, this should work:

Table.AddColumn(#"Colonnes renommées13", "Major", each if [Priority] = "Major" and [Issue Type] = "Bug"  then 1 else 0)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Actually I was trying to transform this power query formula to DAX @Fowmy 

amitchandak
Super User
Super User

@Anonymous , if you creating a measure make sure all other are measures .

 

If you are creating a new column, make sure all these columns are available in same table

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

@amitchandak thanks

actually I'm trying to calculate measure from these columns 'due date' and 'resolution date'

What would be the correct method?

 

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