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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kattlees
Post Patron
Post Patron

Limit import based on date

I am new to Power BI and have decided to do import vs direct query.

 

Is there a way to limit the records imported based on date to save time/space? Our system has 20 years of data and if we only want to import the last 5 or 10 years. Is this possible?

1 ACCEPTED SOLUTION

select filter on your date column and then choose parameter as show below in below circle, and select your parameter.

 

filter.PNG



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

32 REPLIES 32

Hi Kattlees,

 

I have a simillar problem of restricting the number of rows while importing the data from SQL server to power bi using Import connection .

 

I have seen the code for limiting the records from the thread and tried the same but it is showing error.I could not understand the error.

 

Below is my code.

 

let
Source = Sql.Databases("ejazah-live-rds.c52bhszlapad.ap-south-1.rds.amazonaws.com"),
EjazahLive = Source{[Name="EjazahLive"]}[Data],
dbo_tb_SalesData = EjazahLive{[Schema="dbo",Item="tb_SalesData"]}[Data]
FilteredRows = Table.SelectRows(dbo_tb_SalesData, each Date.Month([booking_date])=3)
in
FilteredRows

 

booking_date is adatetime field in the database.

 

Your help is much appreciated!

Thanks

Lavanya

Anonymous
Not applicable

Thank you @kattlees for your suggestion and it is perfectly working already but my issue is on Power BI Embedded could you please give me a suggestion on that.

 

Kindly Regards,

Geetha

Hi GeetzAnju,

 

I  have seen that MS is going to implement,not sure if they implement in last 2 months as I was not following that.

But as of now there is no was to do partial import or Delta import. In my Solution I moved to Direct query as I used date filter to show the data. 

Anonymous
Not applicable

Thank you so much for your response @sanjoyleo I am also working in the same scenario, I have two parameters such as the StartDate and EndDate and it works fine in the Power BI Desktop and Power BI Service too but my problem is it was not working properly in Power BI embedded, I have embedded my report in Asp.Net MVC application and for the parameters I have provided two listboxes for the user to select the StartDate and EndDate, and I am using javascript for specifying the filters to Power BI Service but the filter was not reflecting in the report. Do you have any idea about this please provide your suggestion.

 

Kindly Regards,

Geetha

Hi,

 

I didn't work on that scenario.. so can't help much here.

I guess to clarify, this won't stop the initial import of all records, but will only show 3 years of data for you to create visuals with. I didn't see how to stop the actual import.

v-chuncz-msft
Community Support
Community Support

@kattlees,

 

It depends on the data source. You may do research into the Advanced Editor.

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

select filter on your date column and then choose parameter as show below in below circle, and select your parameter.

 

filter.PNG



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi,

 

I used the advanced filters (greater than or equal to & less than or equal to) to only get data between certain dates. For example between Sept 1st & Oct.31st of 2017.

 

However, the filters don't seem to work, the data extraction keeps going and going trying to extract the entire table. This is not rocket science, just filters, but they don't work.

 

Any thoughts ???

 

 

 

Hi,

 

I used the advanced filters (greater than or equal to & less than or equal to) to only get data between certain dates. For example between Sept 1st & Oct.31st of 2017.

 

However, the filters don't seem to work, the data extraction keeps going and going trying to extract the entire table. This is not rocket science, just filters, but they don't work.

 

Any thoughts ???

 

 

 

parry2k
Super User
Super User

create a date parameter in query editor and filter your table based on that parameter value.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I was able to find how to create a date parameter. how do I apply it to a query?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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