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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
msimmonsmcse
Helper I
Helper I

Issue with counting rows based on a value in another table

I am trying to figure out a measure that will count the number of tickets assigned to a technician. The tricky part is that data coming from my system allows multiple resources to be assigned to a ticket and stores them in its database as a string value with each MemberId seperated by a comma (see sample data below). I want to know exactly how many tickets are assigned to each member based on the Resource_list value containing a match with the MemberID in the Member table. To make matters trickier, the two tables have an inactive relationship between the Ticket_OwnerID field and the MemberID field.

 

Tickets Table

TicketIDResource_listTicket_OwnerID
1JoeSJoeS
2JoeS,JaneDJoeS
3JoeS,MaxFMaxF
4MaxFJaneD
5JaneD,MaxFJoeS
6JoeS,JaneD,MaxFMaxF

 

Member Table

MemberIDMemberName
JoeSJoe Salami
JaneDJane Donut
MaxFMax Freeze

 

Expected Result of Count of Tickets Assigned measure:

Joe4
Jane3
Max4
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @msimmonsmcse 

You can create a new measure and try the following DAX:

MEASURE = 
VAR _currentID =
    SELECTEDVALUE ( 'Member Table'[MemberID] )
VAR _Vtable =
    FILTER (
        CROSSJOIN (
            SELECTCOLUMNS ( 'Member Table', "_MID", 'Member Table'[MemberID] ),
            SELECTCOLUMNS ( 'Tickets Table', "_R_L", 'Tickets Table'[Resource_list] )
        ),
        FIND ( [_MID], [_R_L],, BLANK () ) <> BLANK ()
    )
RETURN
    COUNTX ( FILTER ( _Vtable, _currentID = [_MID] ), [_MID] )

 

Here is my preview:

vyohuamsft_0-1714620547103.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

1 REPLY 1
Anonymous
Not applicable

Hi, @msimmonsmcse 

You can create a new measure and try the following DAX:

MEASURE = 
VAR _currentID =
    SELECTEDVALUE ( 'Member Table'[MemberID] )
VAR _Vtable =
    FILTER (
        CROSSJOIN (
            SELECTCOLUMNS ( 'Member Table', "_MID", 'Member Table'[MemberID] ),
            SELECTCOLUMNS ( 'Tickets Table', "_R_L", 'Tickets Table'[Resource_list] )
        ),
        FIND ( [_MID], [_R_L],, BLANK () ) <> BLANK ()
    )
RETURN
    COUNTX ( FILTER ( _Vtable, _currentID = [_MID] ), [_MID] )

 

Here is my preview:

vyohuamsft_0-1714620547103.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors