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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AlexandreRIVARA
Regular Visitor

How to only pull the mails of the last week with a connection to Exchange through Power Query

I use Power Query to connect to Exchange and then filter to only show the emails with a specific tag that I then turn them into a table of around 5 lines max.

 

The issue is that to get 5 emails I need to pull around 4000 lines through the connection. It takes time and ressources for nothing. I don't need the emails I already treated, nor do I need emails so old that there is no meaning to treat them anymore. I can easyly filter the whole list but that's not what I am looking for here.

 

Is there a way to limit the scope of the connection to only the las week emails ?

 

Any idea is welcomed, thank you.

1 ACCEPTED SOLUTION
edhans
Super User
Super User

You can create a filter on the date column, but I do not think querying against Exchange will fold the queries. In SQL Server for example, Power Query creates a query that includes the date filter, send the query to SQL Server, which runs the query, then returns the results.

With non-foldable sources, you can still set the filter, but it has to pull all data down locally to apply the filter. So your results are correct, but the query takes much longer to run. So in your case, it has to pull down 4,000 records to show you the 50 you care about.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Super User
Super User

You can create a filter on the date column, but I do not think querying against Exchange will fold the queries. In SQL Server for example, Power Query creates a query that includes the date filter, send the query to SQL Server, which runs the query, then returns the results.

With non-foldable sources, you can still set the filter, but it has to pull all data down locally to apply the filter. So your results are correct, but the query takes much longer to run. So in your case, it has to pull down 4,000 records to show you the 50 you care about.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

It is exactly what I feared but at least it is clear.

 

Thank you

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.

Top Solution Authors