Forum Discussion

the_exception's avatar
the_exception
New Member
6 years ago

Power Query Slow When Pulling Data From Exchange

I'm attempting to pull in Categories and Attributes.LastModifiedTime in via Power Query, but it's going exceedingly slow, taking about an hour and a half to grab the approximately 50,000 e-mails in our Shared Mailbox.

 

I'm still relatively new to Power Query, so I don't exactly have a baseline.  The below is the code utilized to pull data in, is there something I'm missing?

 

let
    Source = Exchange.Contents("[email protected]"),
    Mail1 = Source{[Name="Mail"]}[Data],
    #"Removed Columns" = Table.RemoveColumns(Mail1,{"Subject", "Sender", "DisplayTo", "DisplayCc", "ToRecipients", "CcRecipients", "BccRecipients", "DateTimeSent", "Importance", "IsRead", "Attachments", "Preview", "Id", "Body"}),
    #"Extracted Values" = Table.TransformColumns(#"Removed Columns", {"Categories", each Text.Combine(List.Transform(_, Text.From), ";"), type text}),
    #"Expanded Attributes" = Table.ExpandRecordColumn(#"Extracted Values", "Attributes", {"LastModifiedTime"}, {"Attributes.LastModifiedTime"})
in
    #"Expanded Attributes"

1 Reply