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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.