Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Convert Simple Calculated Column Dax to Calculated Measure Dax

 

Table:

 

I created a Calculated Column as

 
Friendly BillAgentName =
IF('Bill agent'[billAgentName]="AP Green", "Green", IF('Bill agent'[billAgentName] = "AEP", "Ada Eco Plural"))
 
I will like to use a calculated measure instead of a Calculated column because I need to improve on perfromance of my Tabular Model.

 

Here is the anticipated result.

 

Result:

 

 

Can I have the Dax for the Calculated measure to accomplish same requirement?

 

 

 

 

  • Hi Anonymous 

    Please try this:

    Switch = SWITCH(TRUE(),MAX('Table'[Names]) = "AP Green","Green",MAX('Table'[Names]) = "AEP","Ada Eco Plural")

    Then if you have any values that return blank in the measure then enable "show items with no data"

     

     

     

    Kind regards,
    Seanan
    If this post helped, please consider accepting it as the solution.

1 Reply

  • Seanan's avatar
    Seanan
    Solution Supplier

    Hi Anonymous 

    Please try this:

    Switch = SWITCH(TRUE(),MAX('Table'[Names]) = "AP Green","Green",MAX('Table'[Names]) = "AEP","Ada Eco Plural")

    Then if you have any values that return blank in the measure then enable "show items with no data"

     

     

     

    Kind regards,
    Seanan
    If this post helped, please consider accepting it as the solution.