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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Counting through multiple tables

Hello, 

 

I am managing data from a client database with Clients, Projects, and project interactions. 

 

I have re-created this within Power BI and am now trying to calculate a few things. One of the problems i'm struggling with is how to count all clients that have had a project interaction since "x" date.

 

There are around 15 projects, and the structure of the model is broadly as follows...

<--> [bidirectional one to many ]

--> [one to many]

 

[Client table] (demographic info) <-->(client id) [Project table 1] --> (linked on project id) [project 1 project interactions]

                                                   <-->(client id) [Project table 2]  -->(linked on project id) [project 2 project interactions]

 

What i need to do is create a measure that counts distinct client record ID if that client had an interaction with any project since a certain date (taken from project interaction table). 

 

What would be the best way to go about this?

 

Thansk 

 

 

 

 

8 REPLIES 8
tex628
Community Champion
Community Champion

Would it be possible for you to take a picture of the relationship pane in PBI? I'm having issues getting a clear picture of the structure.

/J


Connect on LinkedIn
Anonymous
Not applicable

 

Yes - Sorry, didn't realise that I needed to sign in in order to do this...

 

Thanks 

 

Client, project, interaction.PNG

Hi @Anonymous ,

 

Would you please show us some sample data. Please erase unnecessary data and sensitive data, we only need a part for testing.

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Thanks for your replies. I removed the bridge table 'distinct client record id' from the model. So please ignore that in the above screen shot. Here is some mock data: I'm trying to count distinct clients that have had a project interaction since X date. So in the example below. If I select dates as between 01/03/20 ad 01/05/20. then the result will be two clients - John and Mary. Ideally, the solution would allow me to alter the dates and see how many clients in that time easily. I don't know if i need to create an independent dates table for that also? Thanks 

 

See below comment for sample data 

Hi @Anonymous ,

 

The data you gave us is unreadable.

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Sorry-

 

Hope this works

 

Client table         
Client Record IDClient NameClient Age     
1876Steve19     
 
1563
John 26     
1472Mary43     
        
        
        
Elevate Table (project)   Elevate Interactions  
Project Record IDClient Record IDClient Name  Project Record IDInteraction Record IDDate of interaction 
18881876Steve  188822315/05/2020
16541563John   165424507/04/2020
     188812501/05/2020
        
        
Advice and Wellbeing (Project)   Advice and Wellbeing Interactions 
Project Record IDClient Record IDClient Name  Project Record IDInteraction Record IDDate of interaction 
17721472Mary  17722301/04/2020
     17721703/03/2019

Hi @Anonymous

 

Sorry for late reponse. Please follow the steps:

 

1. Create a date table for slicer and create relationship between date table and interacions table(the relationship should be many to one):

Capture2.PNG

Create a measure to filter the client table visual:

Measure = DISTINCTCOUNT('Advice and Wellbeing Interactions'[Date of interaction ])+ DISTINCTCOUNT('Elevate Interactions'[Date of interaction ])

 

Capture4.PNG

 

For more details, please refer to pbix file:   https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EXqyYUAfaxVLv-oecS56pHABnVOGCm2e8jr5BMvv7jsajA?e=y8vV7m

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Thank very much, 

 

I had thought that this would be the solution. Another alternative I thought would be to combine everything in one big table.

 

I'll try by creating a linked date table. 

 

THanks 

 

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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