Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
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
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |