Forum Discussion
Error in Refresh Data from Microsoft Exchange to Power BI attachment email
Hi Experst
I am getting a error upon exporting attachment (Excel) file from microft exhange, i have created the all filter in edit query and its working fine on first stage, however when am receiving updat email next date I am getting error.
let
Source = Exchange.Contents("[email protected]"),
Mail1 = Source{[Name="Mail"]}[Data],
#"Expanded Sender" = Table.ExpandRecordColumn(Mail1, "Sender", {"Name", "Address"}, {"Sender.Name", "Sender.Address"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded Sender", each [Sender.Address] = "[email protected]"),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each Text.EndsWith([Subject], "Madinah Data BI")),
#"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", let latest = List.Max(#"Filtered Rows1"[DateTimeSent]) in each [DateTimeSent] = latest),
#"AAMkAGJiMTg2OGMzLWRlZDEtNDI0MC04OTlhLThiZDFiMWU1OTA0YgBGAAAAAACHHKVnuh1TTIzR3yhL8aLKBwAEgYm+4YUCSZJ3jmvsPvxCAAz6v6+nAAClbRZez8mURKjGea9RW6QMAAJK9RBeAAA=" = #"Filtered Rows2"{[Id="AAMkAGJiMTg2OGMzLWRlZDEtNDI0MC04OTlhLThiZDFiMWU1OTA0YgBGAAAAAACHHKVnuh1TTIzR3yhL8aLKBwAEgYm+4YUCSZJ3jmvsPvxCAAz6v6+nAAClbRZez8mURKjGea9RW6QMAAJK9RBeAAA="]}[Attachments],
AttachmentContent = #"AAMkAGJiMTg2OGMzLWRlZDEtNDI0MC04OTlhLThiZDFiMWU1OTA0YgBGAAAAAACHHKVnuh1TTIzR3yhL8aLKBwAEgYm+4YUCSZJ3jmvsPvxCAAz6v6+nAAClbRZez8mURKjGea9RW6QMAAJK9RBeAAA="{0}[AttachmentContent],
#"Imported Excel" = Excel.Workbook(AttachmentContent),
Hotel_Sheet = #"Imported Excel"{[Item="Hotel",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Hotel_Sheet, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Property Name", type text}, {"Account ID", type text}, {"DOW", type text}, {"Occupancy Date", Int64.Type}, {"Special Event (Impact Forecast = Yes)", type text}, {"User Forecast Rooms Sold", type text}, {"User Forecast Room Revenue (SAR)", type text}}),
#"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type", {{"Occupancy Date", type date}}, "en-NZ")
in
#"Changed Type with Locale"
- Anonymous8 years ago
msarfaraz,
Do all the Excel attachments contain the "Hotel" sheet? And do the sheets contain same columns and same column names?
In your scenario, I would recommend you backup the PBIX file, then remove each APPLIED STEP from last step and check which step the error throws.
Regards,
Lydia
1 Reply
- AnonymousNot applicable
msarfaraz,
Do all the Excel attachments contain the "Hotel" sheet? And do the sheets contain same columns and same column names?
In your scenario, I would recommend you backup the PBIX file, then remove each APPLIED STEP from last step and check which step the error throws.
Regards,
Lydia