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

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

Reply
Anonymous
Not applicable

Count transactions based on multiple variables from another table, including date ranges

Good afternoon kind Power BI users,

 

Here's a simplified version of my challenge:

 

I have a table of transactions and a table of salespeople and their team affiliations. People move from team to team frequently, and I have the start and end dates for each team affiliation.

 

WavePkjnm242_1-1671223278533.png

 

WavePkjnm242_2-1671223288800.png

 

 

In the Transactions table, the team that made the sale has not been recorded, just the individual SalespersonID. (The AttributeToTeam column does not actually exist.)

 

I need to count sales per team for the last 4 years. How can I do this? I'd like to just add a "Team" column to the transactions table, but I would need to create that based on the SalespersonID and SaleDate—in conjunction with the TeamDateFrom and the TeamDateTo in the EmployeeTeamDates table.

 

In other words, the AttributeToTeam column in the Transactions table is what I don't know how to build, and maybe a column like that is not the best solution. It could be a new table, anything...

 

Also note, the null values in the TeamDateTo column indicate that the person is a current employee.

 

Any thoughts? Here's a pbix:

 

TransactionsByTeam_pbix 

 

Thank you!

 

Nick

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , This SCD case, refer

 

SCD
Guyinacube - https://www.youtube.com/watch?v=tKeaQpWynzg

https://www.youtube.com/watch?v=E1ZABKBpkdg

https://www.zartis.com/scd-implementation-with-temporal-tables-in-power-bi/

regression like scatter visual

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I am schooled and humbled. Thank you!

amitchandak
Super User
Super User

@Anonymous , This SCD case, refer

 

SCD
Guyinacube - https://www.youtube.com/watch?v=tKeaQpWynzg

https://www.youtube.com/watch?v=E1ZABKBpkdg

https://www.zartis.com/scd-implementation-with-temporal-tables-in-power-bi/

regression like scatter visual

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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