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
asjones
Helper V
Helper V

Creating a Relationship where the Fact row Must Between Two Values

I have to join two tables based on a few different attributes. I know I can do part of this by using Power Query and concatenating to fields. However the challenge is one of the dimensions varies based on a time frame in the format of a year/month.

 

Fact table

ClientDeptPeriodValue
AB10020190110
AB10020200220
ZY10020190530


Dimension Table

ClientDeptDivisionPeriod_FromPeriod_To
AB100Exec201901201904
AB100F&A201905202012
ZX100PRG201901202112

 

I can concatenate Client and Dept on both tables in Power Querty to do a Join but how do I handle if the Period column is in-between the Period_From and Period To in the Dimension table? I know how I would do this in a traditional SQL Join with a between statement but how do I create the relation in a Power BI Data Model?

 

Any ideas and thoughts?

 

thanks

Alan

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@asjones 

One way is you create a new version of the table when you can all period from the between the range .

Refer how the new table is created using sheet and date for dates, you can do same for the period

https://www.dropbox.com/s/yuv64v0cneseghx/value%20Split%20between%20months%20start%20end%20date.pbix...

 

Refer to these SCD docs

https://powerpivotpro.com/2019/06/how-can-i-get-a-lookup-table-from-a-slowly-changing-dimension-scd/

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

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

@amitchandak 

 

Thanks for the response, that is an interesting solution. It seems like there should be a better way than creating entry for ever point between tow periods (dates). In my case the default Period_to is 209912. So going from say 201000 to 209912 is a huge nubmer of entries to dynamcially create in a table and deal with....

 

I do aprpecite the response, would loveto hear if anyone has other alternate ideas.

 

thanks

 

Alan

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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