The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all
Is there any way for me to count the number of valid attachments within an email in Query Editor? To do that, I need to ignore the header logo, footer logo, other random bits of garbage that show up as attachments on the email. So I need to count the number of attachments where the 'ContentType' field starts with 'Application'
I have aggregated the Attachments column by count of Attachment Name, but I want to add in a condition where the COUNT will only include attachments where the 'ContentType' of the attachment begins with 'Application' - how can I do this please?
My query is currently like this:
let
Source = Exchange.Contents("XXX@XXX.co.uk"),
Mail1 = Source{[Name="Mail"]}[Data],
#"Filtered Rows" = Table.SelectRows(Mail1, each ([Folder Path] = "\Inbox\Purchase Ledger\Invoices\In Query\" or [Folder Path] = "\Inbox\Purchase Ledger\Invoices\New\" or [Folder Path] = "\Inbox\Purchase Ledger\Statements\New\")),
#"Aggregated Attachments" = Table.AggregateTableColumn(#"Filtered Rows", "Attachments", {{"Name", List.NonNullCount, "Count (Not Blank) of Attachments.Name"}})
in
#"Aggregated Attachments"
Many thanks for all help
Found a different way to do this