Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
wpott
New Member

New to Power BI. Trying to get a count after splitting columns

Hello,

 

I am trying to get counts for number of categories related to a finding and/or vice versa, number of findings per category. For example the first finding is listed 3 times because it has 3 different recommendations. If I wanted to get the categories for the entire finding there are only 2 different categories for that entire finding.

 

Do I need to create separate data sources for that? I am stuck because it is counting that finding 3 times or if I split it the other way then it counts the categories as 6 instead of just the 2.

 

Oversight BodyDate of Report ReleaseFiscal Year of Report ReleaseAudit No.Audit NameFinding DescriptionRecommendation DescriptionIssue Category
Internal Audit6/3/2020202020-01-009Name 1A comprehensive contract management plan should be developed.The unit should document current monitoring activities. Performance and Compliance Monitoring
Internal Audit6/3/2020202020-01-009Name 1A comprehensive contract management plan should be developed.The unit should ensure processes and procedures for conducting monitoring activities are established.Performance and Compliance Monitoring; Information and Outreach
Internal Audit6/3/2020202020-01-009Name 1A comprehensive contract management plan should be developed.The unit should ensure that all personnel are trained.Performance and Compliance Monitoring; Information and Outreach

 

 

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

what visual do you want to use to display?

 

you can try to right click the column and change it to count(distcint)

11.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Anonymous
Not applicable

Hi,

Thanks for the solution ryan_mayu offered, and i want to offer some more information for user to refet to.

hello @wpott ,based on your description, you need to transform your table to the following format in power query.

vxinruzhumsft_0-1727318934490.png

In power query, clich the 'Issue Category' column, then select split column by delimiter. and select split them to rows

vxinruzhumsft_1-1727319006042.png

After spliting, select remove the trim.

vxinruzhumsft_2-1727319072188.png

 

And you can refer to the following code in advanced editor in power query.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("zZC9TkMxDIVfxbpzf26LhISYKqYOBQa2qoObmCZS4lw5zn1+3CA6MTAwdLId5xz78/E47FlJGBPsmo86LIbH9cN6O25HS29hOW6W4/hk+Stmgo0lO3AlT0KBuMaZrGIVdAoZGS+UiRWmhAw1lJY8nAk8zZTKRH5l+o9A0DjqT98X17rINZFrzMW6RSJfwGzjHDVSXYFJ30k+i9gcR4Ds4cUWSbGXh5toOC3uB85smhBMUhzVSrWv3Stv7xUM5zrDNwM13l/RAc2BquI5xRq+5/zpEs+w5/5LY+H+7a2pELpwjzfSgAqYEkwktTBT6uBmHfmfoE9f", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Oversight Body" = _t, #"Date of Report Release" = _t, #"Fiscal Year of Report Release" = _t, #"Audit No." = _t, #"Audit Name" = _t, #"Finding Description" = _t, #"Recommendation Description" = _t, #"Issue Category" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Oversight Body", type text}, {"Date of Report Release", type date}, {"Fiscal Year of Report Release", Int64.Type}, {"Audit No.", type text}, {"Audit Name", type text}, {"Finding Description", type text}, {"Recommendation Description", type text}, {"Issue Category", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Issue Category", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Issue Category"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Issue Category", type text}}),
    #"Trimmed Text" = Table.TransformColumns(#"Changed Type1",{{"Issue Category", Text.Trim, type text}})
in
    #"Trimmed Text"

Then in power bi desktop, create a measure.

Measure = DISTINCTCOUNT('Table'[Issue Category])

Put them to a visual.

 

vxinruzhumsft_3-1727319187700.png

Output

vxinruzhumsft_4-1727319195484.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,

Thanks for the solution ryan_mayu offered, and i want to offer some more information for user to refet to.

hello @wpott ,based on your description, you need to transform your table to the following format in power query.

vxinruzhumsft_0-1727318934490.png

In power query, clich the 'Issue Category' column, then select split column by delimiter. and select split them to rows

vxinruzhumsft_1-1727319006042.png

After spliting, select remove the trim.

vxinruzhumsft_2-1727319072188.png

 

And you can refer to the following code in advanced editor in power query.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("zZC9TkMxDIVfxbpzf26LhISYKqYOBQa2qoObmCZS4lw5zn1+3CA6MTAwdLId5xz78/E47FlJGBPsmo86LIbH9cN6O25HS29hOW6W4/hk+Stmgo0lO3AlT0KBuMaZrGIVdAoZGS+UiRWmhAw1lJY8nAk8zZTKRH5l+o9A0DjqT98X17rINZFrzMW6RSJfwGzjHDVSXYFJ30k+i9gcR4Ds4cUWSbGXh5toOC3uB85smhBMUhzVSrWv3Stv7xUM5zrDNwM13l/RAc2BquI5xRq+5/zpEs+w5/5LY+H+7a2pELpwjzfSgAqYEkwktTBT6uBmHfmfoE9f", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Oversight Body" = _t, #"Date of Report Release" = _t, #"Fiscal Year of Report Release" = _t, #"Audit No." = _t, #"Audit Name" = _t, #"Finding Description" = _t, #"Recommendation Description" = _t, #"Issue Category" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Oversight Body", type text}, {"Date of Report Release", type date}, {"Fiscal Year of Report Release", Int64.Type}, {"Audit No.", type text}, {"Audit Name", type text}, {"Finding Description", type text}, {"Recommendation Description", type text}, {"Issue Category", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Issue Category", Splitter.SplitTextByDelimiter(";", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Issue Category"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Issue Category", type text}}),
    #"Trimmed Text" = Table.TransformColumns(#"Changed Type1",{{"Issue Category", Text.Trim, type text}})
in
    #"Trimmed Text"

Then in power bi desktop, create a measure.

Measure = DISTINCTCOUNT('Table'[Issue Category])

Put them to a visual.

 

vxinruzhumsft_3-1727319187700.png

Output

vxinruzhumsft_4-1727319195484.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

ryan_mayu
Super User
Super User

what visual do you want to use to display?

 

you can try to right click the column and change it to count(distcint)

11.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors