Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi guys,
my company is buying some of our raw materials on the Spotmarket and some orders are getting bundled and bought on the Forecast market.
Needless to say, bundling and buying on the Forecast market is cheaper, so I'd like to show the saving potential if 100% is bought through Forecasts for different regions / different companies and so on for different raw materials (see column "Code" in my Screenshots).
Unfortunately as this is company data, I can't post the pbix file.
I have a data table - call it "Items" - that looks like this:
And what I want to show is something like this:
--> As I mentioned I also have a slicer with different raw material codes like H01, H02, S01, O01,...
The user should be able to see the savings for one or multiple codes selected at once.
My first approach was to build a measure like this:
Savings_potential =
VAR Avg_FC_price =
CALCULATE(
SUM(items[Total]) / SUM(items[Quantity]),
Items[FC / Spot] == "FC")
VAR Avg_SP_price =
CALCULATE(
SUM(items[Total]) / SUM(items[Quantity]),
Items[FC / Spot] == "Spot")
VAR Quantity_Spot =
CALCULATE(
SUM(Items[Quantity]),
Items[FC / Spot] == "Spot")
RETURN (Avg_SP_price - Avg_FC_price) * Quantity_Spot
Now I have the following problems:
Now I thought about the following:
Simple problem, but I'm just stuck and have no idea how to continue. Help very much appreciated 🙂
Thanks and best regards
Solved! Go to Solution.
@Anonymous , You need to create a new measure like
new Savings_potential= sumx(summarize(Table, Table[region], Table[Code],"_1",[Savings_potential]),[_1])
A*B should always be a column of row-level calculation(in Measure). If not we need to force a context
also refer:https://www.youtube.com/watch?v=ufHOOLdi_jk
Hi @Anonymous ,
Calculated table or dimension table cant be dynamic,if you hope it to be dynamic,try a measure table,see below video:
https://www.youtube.com/watch?v=qaqyazlEce0
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
@Anonymous , You need to create a new measure like
new Savings_potential= sumx(summarize(Table, Table[region], Table[Code],"_1",[Savings_potential]),[_1])
A*B should always be a column of row-level calculation(in Measure). If not we need to force a context
also refer:https://www.youtube.com/watch?v=ufHOOLdi_jk
Sorry for my late reply. I had to work on another project and just tried it out..
@amitchandak, This is exactly what I was looking for - works perfect. Thanks a lot!!
User | Count |
---|---|
120 | |
95 | |
87 | |
73 | |
66 |
User | Count |
---|---|
138 | |
112 | |
110 | |
98 | |
94 |