Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Hoggy77
New Member

Help with identifying what else is on an invoice with a specific item

I have a data set of invoices and invoice line items. These line items have a related category and sub category for several other tables. 

 

I need to identify all "invoice_no" with items in "itemsubcategory" = "Consult" and then see if that consult was converted and they purchased other items 

 

I have tried Power Query but as the sub category comes from multiple different tables depending if the item is a product, service or package it got too messy. 

Please Help! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Hoggy77 ,

 

You can try below formula:

AdditionalItemsPurchased =
CALCULATE (
    COUNTROWS ( 'LineItems' ),
    'LineItems'[invoice_no] IN VALUES ( Invoices[invoice_no] ),
    'LineItems'[itemsubcategory] <> "Consult"
)

vkongfanfmsft_0-1707118882449.png

 

Best Regards,
Adamk Kong

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Hoggy77 ,

 

You can try below formula:

AdditionalItemsPurchased =
CALCULATE (
    COUNTROWS ( 'LineItems' ),
    'LineItems'[invoice_no] IN VALUES ( Invoices[invoice_no] ),
    'LineItems'[itemsubcategory] <> "Consult"
)

vkongfanfmsft_0-1707118882449.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Hoggy77 , Try a measure like

 

Measure =

var _inv = summarize(calculatetable(Invoice, Item[itemsubcategory]= "Consult"), Invoice[Invoice No])

return

calculate(COuntrows(Invoice), Filter(Invoice, not(isblank(invoice[Purchase Date]))  && Invoice[Invoice No] in _inv))

 

The purchase date condition needs to improve

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors