Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi, how can I split these issue results into individual counts from this table?:
Issue |
Medical Concern |
Medical Concern; ASB - Violence |
ASB - Violence |
Medical Concern; Theft; Missing Person |
Theft |
Theft; Missing Person |
I can isolate the issues by the individual ContainsString Count measures, but in my real-life scenario I have hundreds of "Issues", so I need this to be more automated for all issue types instead of creating 100 individual measures, but not sure how?
I need the outcome to show:
Medical Concern | 3 |
Asb - Violence | 2 |
Theft | 3 |
Missing Person | 2 |
Solved! Go to Solution.
The blank row issue typically occurs because:
The source column contains empty values before splitting
There are consecutive semicolons (;;) in the data, creating empty entries when splitting
Solutions
* Clean data before splitting:
= Table.TransformColumns(#"PreviousStep", {{"Issue", each if _ = null then "" else _, type text}})
* Remove extra delimiters:
= Table.TransformColumns(#"PreviousStep", {{"Issue", each Text.Replace(_, ";;", ";"), type text}})
*Split and filter out blanks:
#"SplitColumn" = Table.SplitColumn(#"PreviousStep", "Issue", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Issue"}) #"Trimmed" = Table.TransformColumns(#"SplitColumn", {{"Issue", Text.Trim, type text}}) #"Filtered" = Table.SelectRows(#"Trimmed", each [Issue] <> "" and [Issue] <> null)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hi @RichOB
1. Use the "Split Column by delimiter" in Power Query
2 Create the measure like this:
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
Hi @Elena_Kalina thanks for your reply. I have followed these steps for my real-life scenario. Unfortunately, the count is the same as if I didn't do the delimiter, but it has now added a blank row with a count of 600. Any ideas why it would add a blank row?
The blank row issue typically occurs because:
The source column contains empty values before splitting
There are consecutive semicolons (;;) in the data, creating empty entries when splitting
Solutions
* Clean data before splitting:
= Table.TransformColumns(#"PreviousStep", {{"Issue", each if _ = null then "" else _, type text}})
* Remove extra delimiters:
= Table.TransformColumns(#"PreviousStep", {{"Issue", each Text.Replace(_, ";;", ";"), type text}})
*Split and filter out blanks:
#"SplitColumn" = Table.SplitColumn(#"PreviousStep", "Issue", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), {"Issue"}) #"Trimmed" = Table.TransformColumns(#"SplitColumn", {{"Issue", Text.Trim, type text}}) #"Filtered" = Table.SelectRows(#"Trimmed", each [Issue] <> "" and [Issue] <> null)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you.
This is great, thanks so much!
Hi @RichOB - I have attached pbix file for your reference.
Please check the file
Snippet FYR:
Output:
Hope this works.
Proud to be a Super User! | |
Hi @rajendraongole1 thanks for your reply. I have followed these steps for my real-life scenario. Unfortunately, the count is the same as if I didn't do the delimiter, but it has now added a blank row with a count of 600. Any ideas why it would add a blank row?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
55 | |
55 | |
37 | |
30 |
User | Count |
---|---|
78 | |
64 | |
45 | |
43 | |
40 |