Forum Discussion
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.
- Anonymous4 years ago
Hi Anonymous ,
Here are the steps you can follow:
1. Go to the power query and select all three columns – Unpivot Columns.
Result:
2. Select the matrix Visual, and place the column [Value] into Rows and Values respectively
And in the Values column, set it to Count..
3. Result:
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
- Anonymous4 years ago
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:
3 Replies
- daXtreme
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 ).
- AnonymousNot applicable
Hi Anonymous ,
Here are the steps you can follow:
1. Go to the power query and select all three columns – Unpivot Columns.
Result:
2. Select the matrix Visual, and place the column [Value] into Rows and Values respectively
And in the Values column, set it to Count..
3. Result:
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
- AnonymousNot 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: