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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AlexaderMilland
Helper III
Helper III

What was bought with a specific product

Hi all,

Having trouble with my measure. It actually calculates the correct sum, but it doesn't show the amount for each product.

 

The idea is that we have 2 product tables, 1 is purely used to make a selection. 

You select a product from this 1 selection table.

 

I then want to show the amount of items bought from orders that have bought item. E.g. you pick pants, i want to see what people who bought pants also bought. 

I got my measure to actually calculate the total sum of products sold (23 in this little fictive model), but it only shows the value for the pants, not for each of the items.

AlexaderMilland_0-1649074270565.png

 

I want each of the items to show like this:

AlexaderMilland_1-1649074281000.png

Measure: 

Client O Items =
var clientprod = ALLSELECTED('Client'[Name])

var clientorders = CALCULATETABLE(VALUES(Orderlines[OrderID]),FILTER('ProductTable','ProductTable'[ProductName] in clientprod
)
)

var salesvar = CALCULATE(SUM(OrderLines[ItemCount]),

FILTER('Orderlines',OrderLines[OrderID] in clientorders
)
)

return
salesvar




link to the datamodel: https://drive.google.com/file/d/17nV3F48UXhsvJSWv7DiB7zdm7tojTPlA/view?usp=sharing

 

 

1 ACCEPTED SOLUTION
AlexaderMilland
Helper III
Helper III
2 REPLIES 2

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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