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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to use query by date not filter

Hello, 

 

I would like to only allow a certain amount of data to be queried into PowerBI. I don't want to load all of the data then filter. Can this be achieved through parameters or SQL? I have done it before, but not sure exactly how. Any suggestions would be great! Thank you!

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Anonymous,

Any date fields stored in your data tables? If that is the case, you can turn on the 'advance' option and write t-sql query to filter on that field based on the max value from your table values.

Power Query SQL Server connector | Microsoft Docs

Regards,

Xiaoxin Sheng

View solution in original post

Anonymous
Not applicable

I used SQL on the source to only allow the first 30 days. Thanks for your help!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I used SQL on the source to only allow the first 30 days. Thanks for your help!

Pragati11
Super User
Super User

Hi @Anonymous ,

 

I think you can use query parameters in Power BI to achieve this.

See this blog: https://blog.crossjoin.co.uk/2020/05/24/limit-the-amount-of-data-you-work-with-in-power-bi-desktop-using-parameters-and-deployment-pipelines/

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Thank you! This blog only shows how to show the last X amount of rows. How do I show only the last 30 days? I want to query by date. Thank you again 🙂

Anonymous
Not applicable

Hi @Anonymous,

Any date fields stored in your data tables? If that is the case, you can turn on the 'advance' option and write t-sql query to filter on that field based on the max value from your table values.

Power Query SQL Server connector | Microsoft Docs

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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