cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jengwt Member
Member

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

Accepted Solutions
jengwt Member
Member

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

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
Super User
Super User

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

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






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Highlighted
jengwt Member
Member

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

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

 

CLIENTS[CLIENTID]  1  to  many CALLS[CLIENTID]

Super User
Super User

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

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






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





jengwt Member
Member

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

You bet.

Microsoft v-huizhn-msft
Microsoft

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

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

jengwt Member
Member

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

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

jengwt Member
Member

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

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?

jengwt Member
Member

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

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

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)