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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
jorismo
Helper II
Helper II

Report beginning of the month, but 6 months ago

Hi all,

 

Currently I'm looking to make an report but I've got some issue's creating it.

The data is imported from an SQL server database, I've selected all the needed fields.

But now there it is 😉

the first part of the report must enter all the data between 2017-01-01 and first day of the month 6 months in the past. (so for today the open_date is between 2017-01-01 and 2020-06-01.

 

The second part of the report must have the open_date between 2020-06-01 (calculated above) and today

 

Is there a way to get the first day of the month 6 months in the past automatically?

 

Many many thanks!

1 ACCEPTED SOLUTION

Hi @jorismo 

 

You could create a measure like below to distinguish whether a date is in a date range. If in the range, the result is 1 otherwise 0. Then use the measure as a table visual filter with value is 1.

Flag = 
VAR firstDateSixMonthAgo = EDATE(DATE(YEAR(TODAY()),MONTH(TODAY()),1),-6)
RETURN
IF(MAX('Table'[Date]) < firstDateSixMonthAgo && MAX('Table'[Date]) >= DATE(2017,1,1),1,0)

 120701.jpg


Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

View solution in original post

3 REPLIES 3
jorismo
Helper II
Helper II

Thanks for your quick response but I don't get it done:

jorismo_0-1606908951276.png

 

I've created the messure 'Datum -6' wich contains (Datum -6 = date(year(today()), month(today()) -6, 1) )

But how do I tell to my table that the Open_date is between 2017-01-01 and 'Datum-6'?

 

Thanks!

Hi @jorismo 

 

You could create a measure like below to distinguish whether a date is in a date range. If in the range, the result is 1 otherwise 0. Then use the measure as a table visual filter with value is 1.

Flag = 
VAR firstDateSixMonthAgo = EDATE(DATE(YEAR(TODAY()),MONTH(TODAY()),1),-6)
RETURN
IF(MAX('Table'[Date]) < firstDateSixMonthAgo && MAX('Table'[Date]) >= DATE(2017,1,1),1,0)

 120701.jpg


Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

amitchandak
Super User
Super User

@jorismo , begining date 6 month before

 

measure  = date(year(today()), month(today()) -6, 1)

rolling 6 month data example

 

Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-6,MONTH))
Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))

 

Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(today(),-1)+1,-6,MONTH))

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.