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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-yangliu-msft
Community Support
Community Support

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
v-yangliu-msft
Community Support
Community Support

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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