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
robarivas
Post Patron
Post Patron

Time Intelligence Puzzle

Looking for a DAX formula that has some sort of dynamic PARRALLELPERIOD functionality. I have 2 periods as follows: "Period A" (a baseline if you will)  and "Period B". Period A spans 3.5 months. Period B is all dates after Period A ends. When a user selects a date range in Period B for a measure (e.g., Sales) I want the DAX formula to compute the average Sales for all exactly matching periods within Period A.

 

For example, lets say the user randomly picks 11 days is Period B (like Sunday June 5 thru Wednesday June 15). And let's say Sales for that period equal 10,050. And lets say Period A begins on March 1 and ends on May 15. I would want to compare the 10,050 to the average of each matching 11 day period within Period A. A matching period (within Period A)  would have to start on Sunday and end on the Wednesday 11 days later. Specifically, based on my logic, the periods in this particular example are as follows: 3/6-3/16, 3/20-3/30, 4/3-4/13, 4/17-4/27, and 5/1-511. Each of those 5 periods have different total Sales. I then want the average of those 5 sums. That average would then be comparable to the 10,050 for 6/5-6/15.

 

Again, this formula would have to dynamically support any range of dates a user might select within Period B whether that be 1 day, 5 days, 10 days, 13 days or whatever.

 

Lastly the model is a simple transactional sales fact table attached to a calendar table.

2 REPLIES 2
tamerj1
Super User
Super User

@robarivas 

Ok let's be serious. Almost everything you asked for is possible except one thing. You cannot slice by variable intervals of time. You can slice by months and filter these months. You slice by weeks and filter these weeks. The time interval must be fixed then we can play how many intervals you want to disply. But in you can the thing that is changing is the time interval while the number of intervals is fixed. I will think further into this as I love puzzles but I don't believe of possible solutions. 

tamerj1
Super User
Super User

@robarivas 

This is the microsoft interview exam question 😅

Helpful resources

Announcements
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!

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.