Forum Discussion
VPRS
1 year agoFrequent Visitor
DSO countback method - MAX Date when condition is met
Hi, I am trying to create a measure to return the MAX Date a variable is greater than or equal to another variable and ultimately return DATEDIFF for the date when the condition is met and lates...
bhanu_gautam
Super User
1 year agoVPRS , Try using
DAX
DSO_TEST_1Measure =
VAR AgeingDate =
CALCULATE(
MAX(PartyAgeing[AgeingDate]),
ALLSELECTED('Date'[Date])
)
VAR ReceivablesTarget =
CALCULATE(
[Total Receivables],
'Date'[Date] = AgeingDate
)
VAR TargetDate =
CALCULATE(
MAX('Date'[Date]),
FILTER(
ALL('Date'[Date]),
'Date'[Date] <= AgeingDate &&
CALCULATE(
[CreditSales],
FILTER(
ALL('Date'[Date]),
'Date'[Date] <= EARLIER('Date'[Date])
)
) >= ReceivablesTarget
)
)
VAR Result =
DATEDIFF(TargetDate, AgeingDate, DAY)
RETURN
IF(
ISBLANK(TargetDate),
BLANK(),
Result
)
VPRS
1 year agoFrequent Visitor
That isn't working unfortunately: