Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm wondering if anyone has any suggestions for me. I have a column that contains multiple values. The format of these values determines the type (2 types). The determinig factor is an added '-' + digits at the end.
The type column is not existing in my data set, that's just to illustrate the difference. How can I include an IF Statement to return a column like 'Type'? The rule would read 'Any value containing a dash is b and any value without a dash is a'
value | type |
100 | a |
200 | a |
300 | a |
300-01 | b |
100-01 | b |
200-01 | b |
200-02 | b |
Solved! Go to Solution.
Or you can use the "Add conditional column" functionality.
Coincidentally, @Sean and I responded to a similar question today.
Assuming the first three values are numbers and not text then the code would be:
let source = #table( {"value"}, { {100},{200},{300},{"300-01"},{"100-01"},{"200-01"},{"200-02"} }), #"added custom" = Table.AddColumn(source, "type", each try if Number.IsNaN([value]) then null else "a" otherwise "b") in #"added custom"
Or you can use the "Add conditional column" functionality.
Coincidentally, @Sean and I responded to a similar question today.
Thank you, this was just what I needed
this is weird!
there is no such option in the German Version!
Am I missing something?
@ImkeFhave you also observed this ??
The column should be formatted as text (or only contain text), then you will have the "Contains" option.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |