Forum Discussion
Anonymous
7 years agoNot applicable
How would you approach this scenario?
Below is my target results that I am trying to achieve (please see screenshot below). Extracting very specific call status types from a string with in a column that currently has " " as delimiters, c...
- 7 years ago
The basic steps would be:
- Split the column by "," delimiter.
- Unpivot all the new columns.
- Remove nulls as desired.
- Split those new columns into their components.
- Load this table into your report and do the concatenation aggregation on the component columns using measures.
You should be able to create filters on these component columns now.
Here's an example query based on a small subset of your data that you can paste into your query editor:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("fVFdT8MgFP0rhCdNqrlA14/HZUbdQ93M+rbuobZkJSIkDGr89942btGlNYRLyLkczj1nv6ebpx1ZmzacvFPyRCO6fHfW4Ll5xvK4u2MZLDgH4DdFLjgnFV11tTvKit5G5AcHBlxc8K2TvTS+9qqXpKiV8b96Y6Ri+TwX5wxAzOEpZLjjeB5PB47Z9wnjgDibwOkhQjec65W2Bi1p7gcTxruWf/0QPAGBfyxYMjnDFf6PHyn2MfRkgmvU8xpqrfwXKa3VpAqYQkIe1CCnkHV7lrZdYhn7SxuarrWfhpSy6YzV9oipnqdZWR0+3sKQ8vrlMk2CC9DROM/iKwWHbw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [site_name = _t, city = _t, state_id = _t, FS_ticket_within_2yr = _t]),
#"Split Column by Delimiter" = Table.SplitColumn(Source, "FS_ticket_within_2yr", Splitter.SplitTextByDelimiter(", ", QuoteStyle.None), {"FS_ticket_within_2yr.1", "FS_ticket_within_2yr.2", "FS_ticket_within_2yr.3", "FS_ticket_within_2yr.4", "FS_ticket_within_2yr.5", "FS_ticket_within_2yr.6", "FS_ticket_within_2yr.7", "FS_ticket_within_2yr.8"}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Split Column by Delimiter", {"site_name", "city", "state_id"}, "Attribute", "Value"),
#"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each [Value] <> null),
#"Split Column by Delimiter1" = Table.SplitColumn(#"Filtered Rows", "Value", Splitter.SplitTextByEachDelimiter({"("}, QuoteStyle.None, false), {"Value.1", "Value.2"}),
#"Split Column by Delimiter2" = Table.SplitColumn(#"Split Column by Delimiter1", "Value.2", Splitter.SplitTextByDelimiter("""", QuoteStyle.None), {"Value.2.1", "Value.2.2", "Value.2.3"}),
#"Removed Columns" = Table.RemoveColumns(#"Split Column by Delimiter2",{"Value.2.3", "Attribute"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Value.1", "FS"}, {"Value.2.1", "M"}, {"Value.2.2", "Descr"}})
in
#"Renamed Columns"
Anonymous
7 years agoNot applicable
STUNNING! So much gratitude...thank you!
How on earth did you come up with that? There is 100% chance that I would have never have got that!
AlexisOlson
Super User
7 years agoLots of practice. I haven't been on these forums much yet, but I've been self-learning Power BI by answering questions on StackOverflow for over a year by now.
- Anonymous7 years agoNot applicable
Stack Overflow? I will start checking it out now because I am learning self-teaching myself DAX, PowerBI, SQL, and Python! Thank you for the advice!