Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |