Forum Discussion

AWentzEco's avatar
AWentzEco
Frequent Visitor
7 years ago
Solved

Learning DAX Calculated Column versus Measure

Can someone explain how I could get this measure to work? I can easily create a calculated column with the correct values but I can't create a Measure. I'm guessing I don't have the correct expression. 

 
MEASURE: (Does not work - every values comes in as "Project Manager")
Project Role = IF(SELECTEDVALUE('PowerSteering_Projects-PBI_-_Metric_Collection_ROI'[EE Role]) = "Black Belt", "Black Belt", IF(SELECTEDVALUE('PowerSteering_Projects-PBI_-_Metric_Collection_ROI'[EE Role]) = "Green Belt", "Green Belt","Project Manager"))
 
 
CALCULATED COLUMN: (This works, and I can see the values for each row in the table.)
Project Role1 = IF('PowerSteering_Projects-PBI_-_Metric_Collection_ROI'[EE Role] = "Black Belt","Black Belt",IF('PowerSteering_Projects-PBI_-_Metric_Collection_ROI'[EE Role] = "Green Belt", "Green Belt","Project Manager"))
 
The column in the Table is called EE Role.
Basically:
IF EE Role = Black Belt, then Black Belt
IF EE Role = Green Belt, then Green Belt
ELSE = Project Manager

 

  • Hi AWentzEco ,

     

    Your formula seems good. We should put a measure in a visual where there are many contexts. It should be like below in your example.

    [EE Role]    [Measure]

     

     

    Best Regards,

2 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi AWentzEco ,

     

    Your formula seems good. We should put a measure in a visual where there are many contexts. It should be like below in your example.

    [EE Role]    [Measure]

     

     

    Best Regards,

    • AWentzEco's avatar
      AWentzEco
      Frequent Visitor

      Thanks. I did that and now both the Measure and Calculated column are coming up with the correct values (both are the same). Perhaps it was a 'Friday' issue. :smileyvery-happy: