Forum Discussion

GShal's avatar
GShal
New Member
2 years ago
Solved

DAX Query

Hi,

I am trying to create ifese function but is is not giving me any column name in logical condition

eXAMPLE: I am creating a new column with condition IF(--  = "Mumbai", true,false)

So where -- is present no column name is coming here it giving me an error in the formula

 

Please help

  • If this is for a measure, you have to use an aggregation function. Trying something like 

    some_measure = IF ( MAX('table'[column]) = "Mumbai", 1, 0)



  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi GShal ,

     

    Thanks Syk  for the quick reply. I have some other thoughts to add:

     

    If you want to create a calculated column, first select a table and then click New Column.

    Enter the following formula.

    Column = IF([Column1]="Mumbai","true","false")

    Then the result is as follows.

     

    Best Regards,

    Neeko Tang

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

2 Replies

  • Syk's avatar
    Syk
    Resident Rockstar

    If this is for a measure, you have to use an aggregation function. Trying something like 

    some_measure = IF ( MAX('table'[column]) = "Mumbai", 1, 0)



  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi GShal ,

     

    Thanks Syk  for the quick reply. I have some other thoughts to add:

     

    If you want to create a calculated column, first select a table and then click New Column.

    Enter the following formula.

    Column = IF([Column1]="Mumbai","true","false")

    Then the result is as follows.

     

    Best Regards,

    Neeko Tang

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