Forum Discussion

ROG's avatar
ROG
Responsive Resident
4 years ago
Solved

New column based on another two columns

Hi all,

 

I'm trying to create a new column based on the two columns below highlighted in pink. 
The new column should say Yes if these two columns have "Yes" and No if one of them is "No".
I tried the the dax below, but it won' work. 




Thank you

RG

  • ROG's avatar
    ROG
    4 years ago

    Thanks a million tamerj1  
    I was indeed using a wrong measure. The below worked. 

    8WK CN Size_SigTest =
    VAR _8WkSigTest = IF([CHI_SQUARE_TAKERS_8_WK_ACTIVE] = "Yes", 1, 0)
    VAR Flag8Wk_CNSize = IF([flag_8_wk] = "Yes",1, 0)

    Return IF( _8WkSigTest = 1 && Flag8Wk_CNSize = 1, "Yes", "No")

6 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi ROG 

    after RETURN change the && to + and change the 1 to 2

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    ROG Try:

    RETURN IF(Flag8Wk_CNSize = 1 && _8WkSigTest = 1, "Yes", "No")

    • ROG's avatar
      ROG
      Responsive Resident

      Thanks for your reply Greg_Deckler 
      It's not working because o the data type. 
      The two measures I used to create the new column a type= text, but the new one I changed from number to general. There isn't an option to change to text for this measure. What woul you do in this case? 

       

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        ROG It would appear that one or both of the columns/measures that you have highlighted are returning numbers and not text. So, you need to address those comparisons. Are they really returning "Yes" and "No"? Doesn't seem like it.