Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello, I have a query to connect via the exchange as I need to count the email addresses in a specific folder (Inbox) for 6 shared mailboxes.
I'm using a custom function:
let
Source = (Account as text) as table=>
let
Source = Exchange.Contents(""&Account&""),
Mail1 = Source{[Name="Mail"]}[Data]
in
Mail1
in
Source
I'm able to get the information, however, the information takes about 10 minutes to load as it validates all the folders.
Is there any way to optimize this in order to quickly load the information just for the Inbox folder?
Here is the table information:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSs7PzU3MS0l1KC5JzSkoytcDCijF6iAkUlJLEjNzMKSLC/Lzc1JSi2HKikuLEzEUFeViFdPDYSZICsOYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Allacount = _t]),
#"Type modifié" = Table.TransformColumnTypes(Source,{{"Allacount", type text}}),
#"Fonction personnalisée appelée" = Table.AddColumn(#"Type modifié", "Email Traffic", each #"Email Traffic"([Allacount])),
#"Email Traffic développé" = Table.ExpandTableColumn(#"Fonction personnalisée appelée", "Email Traffic", {"Folder Path", "Sender", "DisplayTo", "DisplayCc", "DateTimeReceived", "HasAttachments", "Attributes"}, {"Email Traffic.Folder Path", "Email Traffic.Sender", "Email Traffic.DisplayTo", "Email Traffic.DisplayCc", "Email Traffic.DateTimeReceived", "Email Traffic.HasAttachments", "Email Traffic.Attributes"}),
#"Expanded Email Traffic.Attributes" = Table.ExpandRecordColumn(#"Email Traffic développé", "Email Traffic.Attributes", {"LastModifiedName"}, {"Email Traffic.Attributes.LastModifiedName"}),
#"Lignes filtrées" = Table.SelectRows(#"Expanded Email Traffic.Attributes", each ([Email Traffic.Folder Path] = "\Boîte de réception\" or [Email Traffic.Folder Path] = "\Éléments envoyés\")),
#"Colonnes supprimées" = Table.RemoveColumns(#"Lignes filtrées",{"Email Traffic.Sender"}),
#"Type modifié1" = Table.TransformColumnTypes(#"Colonnes supprimées",{{"Email Traffic.DateTimeReceived", type date}}),
#"Semaine de l'année insérée" = Table.AddColumn(#"Type modifié1", "Week number (year)", each Date.WeekOfYear([Email Traffic.DateTimeReceived]), Int64.Type),
#"Filtered Rows" = Table.SelectRows(#"Semaine de l'année insérée", each ([Email Traffic.Folder Path] = "\Boîte de réception\"))
in
#"Filtered Rows"
Solved! Go to Solution.
Hi @rtrejo ,
Before using the source table to transform data in Power Query directly, you can consider to select necessary rows in advance to reduce the table size to import into Power Query.
In addition, if the source table would be used frenquently in a new query, you can try to Table.buffer() to buffer the source table. Please refer this blog which introduces it in details:
Nested functions and Table.Buffer()
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rtrejo ,
Before using the source table to transform data in Power Query directly, you can consider to select necessary rows in advance to reduce the table size to import into Power Query.
In addition, if the source table would be used frenquently in a new query, you can try to Table.buffer() to buffer the source table. Please refer this blog which introduces it in details:
Nested functions and Table.Buffer()
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.