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
msarfaraz
Frequent Visitor

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.

Picture1.png

 

let

    Source = Exchange.Contents("m.sarz@mhj.com"),

    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] = "replies-abc@aol.com"),

    #"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"

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@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

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

View solution in original post

1 REPLY 1
v-yuezhe-msft
Employee
Employee

@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

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

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