Forum Discussion
If Condition for Text not Working
- Anonymous7 years agoSuch things should be done in Power Query (M), not in DAX. Use the right tool for the job. On top of that, M code would be very simple. No messing around with context and context transition.
DAX is a Data Analysis eXpressions language, not data mash-up language. M is.
Best
D. - Anonymous7 years ago
Hi there.
Again, this is not the way to do it. First, you should create an auxiliary table that will hold all the mappings from status to classification. Then, in PQ, you left outer join the target table to the mappings table and get the column you need.
This procedure makes sure you don't have to go back to the M code when you need to change a mapping or add a new one. All you have to do is manage the mappings which can be done in the source through SQL (if your data comes from a relational database).
Best
D.
DAX is a Data Analysis eXpressions language, not data mash-up language. M is.
Best
D.
Anonymous wrote:
Such things should be done in Power Query (M), not in DAX. Use the right tool for the job. On top of that, M code would be very simple. No messing around with context and context transition.
DAX is a Data Analysis eXpressions language, not data mash-up language. M is.
Best
D.
Anonymous Thanks for pointing this out. I was not aware of the two langauges.
I was able to use the Replace Value function on the Column inside the Advanced Editor and now it works.
#"Replaced Value" = Table.ReplaceValue(#"Duplicated Column","Work In Progress","Open",Replacer.ReplaceText,{"Status - Copy"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","Pending Expert","Open",Replacer.ReplaceText,{"Status - Copy"}),
#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","Assigned","Open",Replacer.ReplaceText,{"Status - Copy"}),
#"Replaced Value3" = Table.ReplaceValue(#"Replaced Value2","Pending Submitter Information","Open",Replacer.ReplaceText,{"Status - Copy"}), ..... etc
- Anonymous7 years agoNot applicable
Hi there.
Again, this is not the way to do it. First, you should create an auxiliary table that will hold all the mappings from status to classification. Then, in PQ, you left outer join the target table to the mappings table and get the column you need.
This procedure makes sure you don't have to go back to the M code when you need to change a mapping or add a new one. All you have to do is manage the mappings which can be done in the source through SQL (if your data comes from a relational database).
Best
D.