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

Join 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.

Reply
Anonymous
Not applicable

Count similar strings within a query (example input and output in description)

Hey everyone, I'm looking for help creating a DAX equation to find the same value over a given power query and count the amount of times it appears.

 

Any ideas or ways to go about this.

 

The image attached shows an example of a given table and what the desired result is.

 

Any advice or ideas are welcome.

 

bcordeiro_0-1654268978394.png

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Go to the power query and select all three columns – Unpivot Columns.

vyangliumsft_0-1654582976242.png

Result:

vyangliumsft_1-1654582976242.png

2. Select the matrix Visual, and place the column [Value] into Rows and Values respectively

And in the Values column, set it to Count..

vyangliumsft_2-1654582976244.png

3. Result:

vyangliumsft_3-1654582976245.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Thank you for the help on this. Your method didn't fully solve it the way I needed it however with the unpivoted columns I was able to GROUP the similar texts and sum the quantity value on the same row.

 

Example:

bcordeiro_0-1654777506598.png

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Go to the power query and select all three columns – Unpivot Columns.

vyangliumsft_0-1654582976242.png

Result:

vyangliumsft_1-1654582976242.png

2. Select the matrix Visual, and place the column [Value] into Rows and Values respectively

And in the Values column, set it to Count..

vyangliumsft_2-1654582976244.png

3. Result:

vyangliumsft_3-1654582976245.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

Thank you for the help on this. Your method didn't fully solve it the way I needed it however with the unpivoted columns I was able to GROUP the similar texts and sum the quantity value on the same row.

 

Example:

bcordeiro_0-1654777506598.png

 

daXtreme
Solution Sage
Solution Sage

Input data is not in a format suitable for Power BI. Please unpivot the table first using Power Query so that the columns' names become a column themselves. Then the task will be as easy as a, b, c... Your measure will be simple as well: countrows( T ).

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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