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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.