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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Creating Measurement between fixed Date and calculated Date

'm interested in creating a report comparing a before and after of two equivalent time periods.

 

The after period is looking at the days from a fixed date (1/10/20) to the most recent case in the tbl_Data table (in this case it is 92 days).

 

The before period would subtract the calculated 92 days from the fixed date (1/10/20).

 

I was able to get the days between part fairly easily using the following:

 

Days_Between = calculate( countrows(date_table), DATESBETWEEN( date_table[Date_field].[Date], date(2020,10,01), MAX(tbl_Data[Date Received]) ))

 

However I'm at odds on how to subtract this from the fixed date to get a date range I can filter on easily.

 

Any pointers/ideas would be greatly appreciated.

Cheers

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can create measure like this and try

Rolling -92 = CALCULATE(countrows(date_table),DATESINPERIOD('Date'[Date ],date(2020,10,01),-92,Day))


Rolling 92 = CALCULATE(countrows(date_table),DATESINPERIOD('Date'[Date ],date(2020,10,01),92,Day))

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

3 REPLIES 3
Anonymous
Not applicable

Thanks! I would like to avoid entering the exact day as this will change when i refresh my data source. Using my measurement in lieu of the '92' in your formula seemed to work. Thanks very much 🙂

 

wdx223_Daniel
Super User
Super User

datesinperiod(date_table[Date_field].[Date],date(2020,10,1),-92,DAY)

amitchandak
Super User
Super User

@Anonymous , You can create measure like this and try

Rolling -92 = CALCULATE(countrows(date_table),DATESINPERIOD('Date'[Date ],date(2020,10,01),-92,Day))


Rolling 92 = CALCULATE(countrows(date_table),DATESINPERIOD('Date'[Date ],date(2020,10,01),92,Day))

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
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.