Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have 3 tables to work with that share a relation to eachother... I will use a dummy data set for data privacy purposes.
Orders
Ingredient Matrix
Ingredient List
Quantity in Ingredient list will be the (Σ Orders[Order]) * (Index('Ingredient Matrix'[Column1],[Row1]))
For example, say we had a slicer for Order type
our Ingredient List would show the quantities of the formula...
Σ(Σ Orders[Order]) * (Index('Ingredient Matrix'[Column1],[Row1]))
2 Cake * 1 Egg = 2 Egg
2 Cake * 2 Flour = 4 Flour
2 Cake * 3 Vanilla = 6 Vanilla
2 Cake * 1 Chocolate = 2 Chocolate
So you could essentially be able to slice by any of the attributes and get a running total of what you need to go and buy.
I was able to do this with excel pretty easily given that it has hlookup, but the lack of ability to transpose search values makes it quite difficult to do.
Similar forum posts revolve around using unpivot query but the formulas in themselves are confusing me...
I currently use the formula zEgg = SUMX(Orders, RELATED(IngredientMatrix[Egg])) as a measure and it works, but I have to run this calculation for each ingredient. I would have zEgg, zFlour, zVanilla, zChocolate... It gets tedious when I am working with 30+ parts in my real data set.
Would appreciate any insight, as I am new to DAX. It seems like it has the same capabilites of Excel, it just requires you to jump through a lot more hoops.
Hi @06jakegillespie , If you unpivot the ingredient matrix in powerquery, this will normalize your data and make calculations easier.
Hope this helps,
Did I help you today? Please accept my solution and hit the Kudos button.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
87 | |
49 | |
45 | |
38 | |
37 |