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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors