Forum Discussion
IF function not working
Hi,
Can someone explain me what's wrong with this formula?
Thanks
Anonymous
If you are creating a measure then, this shouldMeasure = if ( MAX(table[Due Date]) = "null", "9999", MAX(table[Resolution Date]) - MAX(table[Due Date]) )work.
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)Anonymous
You can add as a column to your table using DAX:Major = if ( and([Priority] = "Major" , [Issue Type] = "Bug" ) , 1 , 0)
7 Replies
- amitchandakSuper 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
- AnonymousNot applicable
amitchandak thanks
actually I'm trying to calculate measure from these columns 'due date' and 'resolution date'
What would be the correct method?
- FowmySuper User
Anonymous
If you are creating a measure then, this shouldMeasure = if ( MAX(table[Due Date]) = "null", "9999", MAX(table[Resolution Date]) - MAX(table[Due Date]) )work.
- AnonymousNot 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)
- FowmySuper User
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)