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
zina-aziz
Frequent Visitor

Creating a date filter for a date range

Hi everyone,

 

I am working with hotel data which contains nightly rates per hotel with a validity date range as follows:

 

Hotel El Aurassi180.0001-Jan-1731-Dec-17
Epic Sana Luanda190.0001-Feb-1731-Nov-17
Alvear Palace Hotel220.0001-Mar-1731-Oct-17
Alvear Palace Hotel290.0001-Jan-1731-Dec-17
Casasur Bellini Hotel130.0001-Feb-1731-Nov-17
CasaSur Recoleta Hotel190.0001-Mar-1731-Nov-17
Dazzler Tower Recoleta85.0001-Jul-1731-Aug-17
Faena Hotel Buenos Aires195.0001-Jan-1931-Dec-19
Four Seasons Hotel Buenos Aires218.0001-Jan-1831-Dec-18

 

I am trying to create a date filter, so when I select for example January 2017, it will only show me the hotels and the rates that are valid for that month. Is this possible? If so how do I go about creating it?

 

Thank you in advance!

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my solution PBI file from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my solution PBI file from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you so much Ashish.

 

The solution you have created is exactly what I am after, however I am finding it hard to recreate in my master data file. Would you be generous as to provide me with an explanation of how you achieved it? I am a beginner to Power BI, so a step by step would be much appreciated.

 

Thank you again.

 

Zina

Hi,

 

You are welcone.  I suggest that you go to Home . Edit Queries and look at each of the Applied steps on the right hand side pane.  If you are unclear about any step, please feel free to post back.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you. 

 

I am getting this error message. I am not sure what it means.

powerbi.JPG

 

 

Hi,

 

The simple formula in the Query Editor should be:

 

={Number.From([From])..Number.From([To])}


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you it is working now.

 

The calender, is that a table? Also how do i add the month, order and year components underneath it? Are they measures?

 

POWERBI II.JPG

Hi,

 

Yes, Calendar is a Table.  To extract the Year and Month from a date, use these calculated column formulas

 

=YEAR(Calendar[Date])

=FORMAT(Caledar[Date],"mmmm")

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.