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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
as5948
New Member

DAX to count text from the columns containing comma seperated values

Hi All, I have a column like this which contains 0-4 values from 6 of these values "A,B,C,D,E,F"
Input

Changes
A,B,D,E
A,E
C
C,E,A
D

I want a DAX to return the count of A,B,C,D,E,F
Like
A = 3

B=1

C=2

D=2

E=3

F=0

 

2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @as5948 
Please refer to attached sample file. In case you don't have the table of the unique changes then use

1.png

Then use the followig measure

2.png

View solution in original post

ThxAlot
Super User
Super User

Easy solution for beginner

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WctRx0nHRcVWK1QGxIbQzhNRx1XEEs1yUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Changes = _t]),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Changes", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Changes"),
    Count = Table.Group(#"Split Column by Delimiter", "Changes", {"Count", Table.RowCount})
in
    Count

ThxAlot_0-1681719826296.png

ThxAlot_1-1681719918247.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

Easy solution for beginner

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WctRx0nHRcVWK1QGxIbQzhNRx1XEEs1yUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Changes = _t]),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Changes", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Changes"),
    Count = Table.Group(#"Split Column by Delimiter", "Changes", {"Count", Table.RowCount})
in
    Count

ThxAlot_0-1681719826296.png

ThxAlot_1-1681719918247.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



tamerj1
Super User
Super User

Hi @as5948 
Please refer to attached sample file. In case you don't have the table of the unique changes then use

1.png

Then use the followig measure

2.png

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.