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.
Hello all,
I have below measure / visual table:
I only want to show values when CostCategory = "ADD"
the filling down by lastnonblank needs to keep on working (obviously).
no matter where I try to filter, I never get a value for "ADD" only at every date.
thanks for your help!!
Solved! Go to Solution.
Hi @jmpmolegraaf , hello rajendraongole1, thank you for your prompt reply!
Try the following measure:
lastnonblank =
IF(
MAX(UpstreamMargins[CostCategory]) = "Add",
CALCULATE(
LASTNONBLANK(
UpstreamMargins[AppDate],
SUM(UpstreamMargins[UM (USD/HL)])
),
_Calendar[Date] <= MAX(_Calendar[Date])
),
"")
Result:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jmpmolegraaf , hello rajendraongole1, thank you for your prompt reply!
Try the following measure:
lastnonblank =
IF(
MAX(UpstreamMargins[CostCategory]) = "Add",
CALCULATE(
LASTNONBLANK(
UpstreamMargins[AppDate],
SUM(UpstreamMargins[UM (USD/HL)])
),
_Calendar[Date] <= MAX(_Calendar[Date])
),
"")
Result:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jmpmolegraaf - can you create a measure using LASTNONBLANK only considers rows where CostCategory = "ADD"
LastNonBlankADD =
VAR LastDate =
CALCULATE(
MAX( 'Table'[Date] ),
'Table'[CostCategory] = "ADD"
)
RETURN
CALCULATE(
MAX( 'Table'[Date] ),
'Table'[Date] = LastDate,
'Table'[CostCategory] = "ADD"
)
If the measure still doesn't work as expected, let me know how it's behaving and also share pbix file by removing sensitive data.
Proud to be a Super User! | |
will test, much appreciated 🙂
just curious, you do not use lastnonblank -- why?
@jmpmolegraaf -Good question! The reason I didn't use LASTNONBLANK in my first response is that the issue you're facing is more about filtering while maintaining the fill-down behavior, rather than just retrieving the last non-blank value.
Hope it works. please check
Proud to be a Super User! | |
unfortunately I can't get it to work...
User | Count |
---|---|
79 | |
74 | |
44 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
52 | |
50 | |
46 |