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! Learn more

Reply
Anonymous
Not applicable

Date Range

Hi all, 

 

My client has requested me to have a specific date range within a chart. 

Can anyone show me how to create a date range as follows: 

Min Date: Current Month - 2

Max Date Current Month +6

This should cover 9 months of data. 

 

Thank you.

1 ACCEPTED SOLUTION

Hi @Anonymous 


You can downlad this calendar table and apply the filter as below.

 

image.png

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

13 REPLIES 13
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

You shoud be able to use Relative date filtering.
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Mariusz 

 

I do know how relative date filtering works, but I have not been able to set it for the specified range: 

Min Date: Current Month - 2

Max Date Current Month +6

This should cover 9 months of data. 

 

Do you know how to do it ?

 

Thanks! 

Hi @Anonymous 


You can downlad this calendar table and apply the filter as below.

 

image.png

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Anonymous
Not applicable

@Mariusz Thanks for helping me with this, I am however solutioning this in a established data mdel. 

Can you please let me know how did you build the sYear field?

 

Hi @Anonymous 

Please download the file and see the Query Steps it should be fairly easy to understad.

If you are struggling then please let me know.

Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Mariusz 

I am almost there, 

Date.Year([Date]) - nowYear is the custom column sYear

However how do I get the variable nowYear? 

 

Thanks 

Hi @Anonymous 

This will be 
nowYear = Date.Year(nowDate)
nowDate = Date.From(nowDateTime)
nowDateTime = DateTime.LocalNow()

Hope this helps.

Mariusz

Anonymous
Not applicable

@Mariusz are these also columns ? 

Hi @Anonymous 

Now this are queries in variebles folder

Thanks

Mariusz

Anonymous
Not applicable

Ok @Mariusz thank you so much! I will mark your solution as accepted. 

I have one other thing I need your help. I will open a new ticket.

Thanks. 

Anonymous
Not applicable

@Mariusz 

There is one issue, I do not have the advanced filter options as you do.

I do not have "Less than or equal to" for example. 

filter.png

Hi @Anonymous 

 

Make sure you chage the data type in query editor to Whole Number. 

image.png


Regards,
Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

@Mariusz done! 

Perfect! 

cheers 

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.

Top Solution Authors