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
LeoQ
Helper I
Helper I

Counting text values from 2 columns using aonther table as a criteria

Hi everybody, it's my first time I'm writting here because I always found solutions here, but his wasn't the case.

I am working with responses from a form and there's one column named 'Teams', where the same person may be part of different teams. For example, I can find "Mike - Eva" as well as "Eva - Mary".

As I'm trying to know how many times every person appears in the table, I divided the column into many others, getting different columns with only 1 name.

However, when I want to know how many times every name appears in the table (taking into account that 1 name may appear in different columns), I get stuck.

I created a new table with every name and it is related to every column I got when divided the main one. I tried to build a measure but I couldn't, specially beacuse the functions I used only return the first column and not the others.

 

I hope I'd been clear and sorry for this long message.

Thanks a lot!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, on the Split screen window, click on Advanced and select rows there.  This way, all names will appear in a single column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
LeoQ
Helper I
Helper I

Thanks for your answers! I'll give an example
I have 2 initial tables, TABLE A with people and TABLE B, with information about request they solved.

 

However, I divided the column team in TABLE B, so I got the TABLE C.

 

How can I know how many times each name appears in TABLE C? taking as reference the names on TABLE A (I have to manipulate this data in order to build some performance measures).

 

 

tables.png

I'm sorry i had to send the tables as photo, but the editor showed me errors when I wrote the tables in here.
Thanks a lot!

Hi @LeoQ ,

 

You can unpivot your table C and then use the following measure:

 

Meaure = CALCULATE(COUNT(tableC[VALUE]),FILTER(tableC, tableC[VALUE] = MAX(tableA[name])))

 

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

 

Best Regards,

Dedmon Dai

Hi,

Have you tried my suggestion? 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, on the Split screen window, click on Advanced and select rows there.  This way, all names will appear in a single column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Is there a way to make that task automatically? beacuse I have to work with real-time data.

Thanks!

Hi,

What do you mean by that?  The process I shared is a one time activity.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Sorry for the delay in my reply. Even though it generates tons of rows when I have 9 different values in 1 column, it really helped to make the count. Thanks a lot!

mahoneypat
Employee
Employee

Please share some example/mock data so a specific solution can be suggested.  If you've split your name strings into columns, you'll want to unpivot those colums for easier analysis with DAX.  However, you likely could keep the string intact and use SEARCH.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.