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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
jengwt
Helper V
Helper V

Filter Results of visual of Table A by slicer pertaining to Table B

I know the name sounds convoluded, but it's a simple enough problem, I'm just having trouble getting it to work.

 

Say that table CLIENTS contains a record of clients, and table CALLS contains phone calls made to clients. They are linked by the 1-* (CLIENTS-CALLS) field, CLIENTID.

 

Now, I want to display a pie graph of the number of clients that have and have not been called in a given time period. This time period is defined by a slicer pertaining to the DATE field of the CALLS table.

 

So far I've got all of this last bit to work correctly. The pie chart is not responding to the slicer.

 

So far, I've been trying to use the results from a new column in CLIENTS:

CalledInPeriod = IF(CALCULATE(COUNT(CALLS[CALLID])

                                                   , FILTER(CALLS, AND(

                                                                                     AND(MIN(CALLS[DATE]) <= CALLS[DATE]

                                                                                             , CALLS[DATE] <= MAX(CALLS[DATE])

                                                                                             )

                                                                                     , CALLS[CLIENTID] = 'CLIENTS'[CLIENTID]

                                                                                    )

                                                                )

                                                     ) > 0

                             , 1

                             , 0)

 

CALLID is a distinct identifier for each call.

 

Thanks for any help!

 

1 ACCEPTED SOLUTION
jengwt
Helper V
Helper V

I think I got it to do what I want it to do. Had to create 3 Measures, then display the latter two in a pie chart. Was trying to do it with smart columns before.

 

Calls Per Site = COUNT(CALLS[CALLID])

 

Sites Called = CALCULATE(COUNT('CLIENTS'[CIENTID]), FILTER('CLIENTS', [Calls Per Site] >= 1))

 

Sites Not Called = CALCULATE(COUNT('CLIENTS'[CLIENTID]), FILTER('CLIENTS' [Calls Per Site] < 1))

View solution in original post

8 REPLIES 8
jengwt
Helper V
Helper V

I think I got it to do what I want it to do. Had to create 3 Measures, then display the latter two in a pie chart. Was trying to do it with smart columns before.

 

Calls Per Site = COUNT(CALLS[CALLID])

 

Sites Called = CALCULATE(COUNT('CLIENTS'[CIENTID]), FILTER('CLIENTS', [Calls Per Site] >= 1))

 

Sites Not Called = CALCULATE(COUNT('CLIENTS'[CLIENTID]), FILTER('CLIENTS' [Calls Per Site] < 1))

jengwt
Helper V
Helper V

I know, what if I'm approaching this the wrong way? Maybe the solution is to list the distinct CALLS[CLIENTID]s, count them, and then somehow count the remaining CLIENTIDs in the CLIENTS table. But how?

parry2k
Super User
Super User

I assumed you already have relatonship set between both the tables, please confirm?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Yes, both tables had a CLIENTID field, which is the unique identifier in the CLIENTS table.

 

CLIENTS[CLIENTID]  1  to  many CALLS[CLIENTID]

Did you set up the relationship in powerbi between those two tables?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

You bet.

Hi @jengwt,

Have you resolved your issue? Please feel free to ask if you have, otherwise, please mark the right reply as answer, so more people will benefit from here.

Thanks,
Angelia

No, I have not. The issue is not so basic as a simple relationship between two tables. I will not mark an answer.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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