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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
j_hoyt
Frequent Visitor

How should I model this? A table of scheduled events, and a table of people entering and exiting.

The data model is not revealing itself to me. 

 

I have a table of schduled events that are 30-45 minutes long. (say, Event ID, Event Start DateTime).

And I have a table of when people enter the area. (say, Person ID, Entry DateTime).

 

Assume something like, if they enter within 15 minutes before or after the Event Start, I declare them to have attended.

 

How can I model this to see how many people were at each event? 


I'll say that I already solved this by merging the two tables in Power Query on Event Date and Entry Date, then filtering for the times that met my criteria. But I have a feeling that I should solve this through a proper model. 

1 ACCEPTED SOLUTION

You have 2 choices.
1.load a second full copy of your dim table and join to that

2.add the column in PQ instead. Doing this is harder and beyond the scope of what I can type on my iPad. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

3 REPLIES 3
MattAllington
Community Champion
Community Champion

I would treat this as a banding exercise. The second table, when people enter the area is the "transaction" data but it lacks the "event" that they were assumed to have attended. You can band it using PQ or DAX. In short, add a new column to the transaction table. The code needs to filter the event table so only one row remains, the row that is the event. Then the event code can be added to that transaction in the table. 

the general concept is covered here https://exceleratorbi.com.au/banding-in-dax/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Thank you, that is a helpful pattern to know. It gets me one value from the Event table, but it would be nice to have more (Event Name, Event Start Time, other Event data, etc). I got the Event ID into the Transaction table, but I couldn't make a relationship between Transaction and Event because it would make a circular dependancy. 

You have 2 choices.
1.load a second full copy of your dim table and join to that

2.add the column in PQ instead. Doing this is harder and beyond the scope of what I can type on my iPad. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors