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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
NandhaKumarPBI
Frequent Visitor

How to filter date range in graph by previous month(s) till current date

Hi Team,

 

I am new here , and would love to get your help on this!

 

I am working on a dashboard where using a line graph, the date range on that needs to filtered for 6 months (Previous 6th month to 'Till Date') eg: 01 June 2020 to 05 Novemeber 2020 (Current Date).

 

I tried to use the relative filter but both the month Options did not do what i need.

 

Can you kindly help me out on this one!

 

Thanks in advance!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@NandhaKumarPBI , Try a rolling measure like this with a date table

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

 

Also, refer to this video: https://www.youtube.com/watch?v=duMSovyosXE

View solution in original post

v-jayw-msft
Community Support
Community Support

Hi @NandhaKumarPBI ,

 

Relative date slicer should work. Or you could create a measure as below and add it to visual filter.

Measure = IF(SELECTEDVALUE('Table'[date])>=EDATE(TODAY(),-6),1,0)

2.PNG

3.PNG

 

Best Regards,

Jay

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

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @NandhaKumarPBI ,

 

Relative date slicer should work. Or you could create a measure as below and add it to visual filter.

Measure = IF(SELECTEDVALUE('Table'[date])>=EDATE(TODAY(),-6),1,0)

2.PNG

3.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@NandhaKumarPBI , Try a rolling measure like this with a date table

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

 

Also, refer to this video: https://www.youtube.com/watch?v=duMSovyosXE

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.