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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.