March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
So here is my business scenario:
In this case, "Sugar Type B" price shall be shown on Material Master Level (highlighted in green), because of the "1" in the order priority.
That worked fine based on this MEASURE:
Top Order Priortiy Price =
VAR MinOrderPriority = MIN (Prices[Order Priority])
VAR Top1 =
TOPN (
1,
VALUES ( Prices[Order Priority] ),
[MinOrderPriority ],
ASC
)
VAR Result = CALCULATE( [Material Price], Top1)
RETURN
Result
Next step, I add a running price. I repeat the last available negotiated price every month until a new negotiated price is available (to put it on a line chart, without blanks). In a table format it looks like this:
However, as you can see, the red highlighted result is not what I need. My goal is that the Material Type Price with the MIN Order Priority will always be shown on Material Master level. Right now this is not the case, because Sugar Type B has only a negotiated price in 2022-01, whereas Sugar Type A has negotiated price in 2022-04 - therefore starting 2022-04, the TOPN measure on Material Master will show Type A, due to the evaluation context. Here the MEASURE I used:
Top Order Priority Price Running =
VAR LastNonBlankDate =
CALCULATE (
MAX ('Calendar'[Year Month]),
FILTER (
ALL ( 'Calendar'[Year Month] ),
'Calendar'[Year Month] <= MAX ( 'Calendar'[Year Month] )
&& [Top Order Priority Price] <> 0
)
)
RETURN
CALCULATE (
[Top Order Priority Price],
FILTER (
ALL ( 'Calendar'[Year Month] ),
'Calendar'[Year Month] = LastNonBlankDate
)
)
In my mind the solution shouldn't be that complicated, I assume I should remove some filter context or use virtual tables somewhere....I am just too stupid I guess, can't produce a result that works after many many hours of failing....Also my goal is to use a measure without adding a physical table, in order to keep dynamic slicer possibilities and reduce storage. An additional column that somehow works would be fine of course...
Here again my desired outcome on only Material Master level:
Thanks a lot for your kind support!
Solved! Go to Solution.
Thank you! I solved it by now.
Hi @I_LOVE_POWER_BI ,
Could you pls share your pbix file and remember to remove confidential data.
Best Regards
Lucien
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |