Forum Discussion
How to replace column values using DAX measure?
- 3 years ago
Try this measure:
Output Value = SWITCH ( MAX ( Table1[Existing Field Values] ), 1, "P1", 2, "P2", 3, "P3", BLANK (), "Other" )
Anonymous,
The simplest approach is to create a custom column (Power Query) or calculated column (DAX). If neither of these are options, temporarily change your measure to return the first SWITCH argument:
MAX('DimCatalogItemServiceSDD'[ItemName])
It appears there is a value in ItemName that is not in your SWITCH expression (causing it to return "Nada").
I appreciate the response. I get what you're saying, but I'm not sure how to modify the measure to return the first result. Can you provide what the full measure would look like based on the above example? Thanks!
- DataInsights2 years agoSuper User
Anonymous,
Something like this:
Test Measure = MAX ( 'DimCatalogItemServiceSDD'[ItemName] )You mentioned that you added your measure to a blank table visual. That means there's no filter context (other than external filters) so the max value of ItemName in the entire column (considering external filters) is what gets returned. It's better to create a lookup table than to use DAX.