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
tc97
Frequent Visitor

Calculated Column - DATEDIFF - Days Since Promo Start

Hi, 
I have two tables - one for sales, and one for promotions we run. 

 

Sales table includes following columns:

OrderIDOrderDatePromoCodeOrderValue

 

Promotions table consists of only two columns:

PromotionCodePromoStartDate

 

I'm looking to add a calculated column 'PromotionDay' to the Sales table to return how many days into the Promotion the order was placed. Is this relatively simple to calculate?

 

example below:

 

Promotion Table includes record: PromotionCode = 'SPRING22', PromoStartDate = '01 March 2022'

Sales Table would have the below record

OrderIDOrderDatePromoCodeOrderValuePromotionDay
00098705 March 2022SPRING22£150.995

 

Thanks in advance.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @tc97 
Please try

 

PromotionDay =
DATEDIFF ( RELATED ( Promotions[PromoStartDate] ), Sales[OrderDate], DAY )

 

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @tc97 
Please try

 

PromotionDay =
DATEDIFF ( RELATED ( Promotions[PromoStartDate] ), Sales[OrderDate], DAY )

 

tc97
Frequent Visitor

That was nice and easy! Thanks so much!!

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!

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.