cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Deepak Frequent Visitor
Frequent Visitor

how to limit email data source to specific folder

Hi Guys, 

 

Hope you can help me with this one.

 

I have a report that is currently using an Exchange Online data source to collect emails, however as the mail box is fairly large, i would like to apply a filter so that it only pulls data from a nominated mail folder. In my case the Inbox.

 

 

I have tried applying a filter to do this, but it still refreshes the entire mailbox, which does take time.

 

Any ideas? my data source settings below....

 

Source = Exchange.Contents("my@email.com"),
Mail1 = Source{[Name="Mail"]}[Data],
#"Filtered Rows" = Table.SelectRows(Mail1, each true),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Attachments", "Preview", "Body", "Attributes"}),
#"Extracted Values" = Table.TransformColumns(#"Removed Columns", {"Categories", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
#"Expanded Sender" = Table.ExpandRecordColumn(#"Extracted Values", "Sender", {"Name"}, {"Sender.Name"}),
#"Filtered Rows1" = Table.SelectRows(#"Expanded Sender", each ([Folder Path] = "\Inbox\"))
in
#"Filtered Rows1"

3 REPLIES 3
v-jiascu-msft Super Contributor
Super Contributor

Re: how to limit email data source to specific folder

Hi @Deepak,

 

According to my test, the step "#"Filtered Rows"" in your codes seems to be failed. It looks like this in my test:

 

#"Filtered Rows" = Table.SelectRows(Mail1, each ([Folder Path] = "\Drafts\"))

There are only one row in my test, so the refreshing is very fast.

how to limit email data source to specific folder.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Re: how to limit email data source to specific folder

I also get this exact same issue.

 

Its not that the filter within the steps don't work, but when you apply the steps - and it starts the download, I can see it running through all of the folders initially rather than just going to the selected set of folder.

 

My guess is that its step 1 and 2 which still require the entire dataset to be pulled into the query for it to then be filtered.

 

Is there a way around this, so we can select at source a specific folder, as without I seem to be struggling and have to wait an hour for the full dataset to download to enable me to apply any new steps.

 

Thanks

Neil

MariusB Occasional Visitor
Occasional Visitor

Re: how to limit email data source to specific folder

Hello Everybody,

 

As Nejo said, filters have no effect and when you apply them, all mails are load first and then it is filter. 

 

So during refresh or loading you can see PBI desktop running through all of the mailbox folders initially rather than just going to the selected set of folder. 

 

Did anyone find a work around to avoid this loss of time?

 

Kinds Regards, 

 

Marius

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 200 members 2,291 guests
Please welcome our newest community members: