Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Combining two formulas

Hello,

 

I am trying to figure out how to add a formula that will look at two coloums and will return one value based on the critera. I want it to return value "Yes" where the resource is pricing and the TaskId is >=90 and "No" when either 1 or both of those if false. I keep on getting an error when i try to make the formula. Something about the dax comparison operations do not support comparing values of type True/False with values of type Text. Below is a table to help.

 

 

  • The [TaskId] = "03" has to be type text. Try as:

    Column = 
    IF(
        'Table'[Resource] = "Pricing" && VALUE('Table'[TaskId]) >= 90,
        "Yes",
        "No"
    )

    or as a measure:

    Measure = 
    IF(
        SELECTEDVALUE('Table'[Resource]) = "Pricing" && VALUE(SELECTEDVALUE('Table'[TaskId])) >= 90,
        "Yes",
        "No"
    ) 

3 Replies

  • Perhaps your taskId column is of type text? If so, change that to numeric type and try the formula again.

    • Anonymous's avatar
      Anonymous
      Not applicable

      The same error appears.

       

       

      • ChrisMendoza's avatar
        ChrisMendoza
        Resident Rockstar

        The [TaskId] = "03" has to be type text. Try as:

        Column = 
        IF(
            'Table'[Resource] = "Pricing" && VALUE('Table'[TaskId]) >= 90,
            "Yes",
            "No"
        )

        or as a measure:

        Measure = 
        IF(
            SELECTEDVALUE('Table'[Resource]) = "Pricing" && VALUE(SELECTEDVALUE('Table'[TaskId])) >= 90,
            "Yes",
            "No"
        )