Forum Discussion
Dax_Rookie
8 years agoFrequent Visitor
Calculating overdues over time with DAX
Hi, I'm still new to DAX and having trouble wrapping my head around Date Context. I am trying to calculate overdue receivables at various points in time, i.e. how many receivables were overdu...
- 8 years ago
Check the DAX below.
Measure = CALCULATE ( SUM ( Duplicatas[Value] ), FILTER ( ALL ( Duplicatas ), Duplicatas[State] = "approved" && Duplicatas[Due Date] < MIN ( Dates[Date] ) && ( Duplicatas[Paid Date] = BLANK () || Duplicatas[Paid Date] > MAX ( Dates[Date] ) ) ) ) - 8 years ago
Thanks a lot! The following ended up working:
(R$) Overdue Invoices = CALCULATE ( SUM ( Duplicatas[Value] ), FILTER ( ALL ( Duplicatas ), Duplicatas[State] = "approved" && Duplicatas[Current Due Date] < MIN( MAX( Dates[Date] ), TODAY() ) && ( Duplicatas[Paid Date] = BLANK () || Duplicatas[Paid Date] > MAX ( Dates[Date] ) ) ) )
v-chuncz-msft
Community Support
8 years ago
Check the DAX below.
Measure =
CALCULATE (
SUM ( Duplicatas[Value] ),
FILTER (
ALL ( Duplicatas ),
Duplicatas[State] = "approved"
&& Duplicatas[Due Date] < MIN ( Dates[Date] )
&& (
Duplicatas[Paid Date] = BLANK ()
|| Duplicatas[Paid Date] > MAX ( Dates[Date] )
)
)
)
Dax_Rookie
8 years agoFrequent Visitor
Thanks a lot! The following ended up working:
(R$) Overdue Invoices =
CALCULATE (
SUM ( Duplicatas[Value] ),
FILTER (
ALL ( Duplicatas ),
Duplicatas[State] = "approved"
&& Duplicatas[Current Due Date] < MIN( MAX( Dates[Date] ), TODAY() )
&& (
Duplicatas[Paid Date] = BLANK ()
|| Duplicatas[Paid Date] > MAX ( Dates[Date] )
)
)
)