Forum Discussion
cprine
5 years agoFrequent Visitor
Using DATESBETWEEN with relative date ranges
Hello, I am attempting to sum balances of invoices in a relative date range in the past. However, it returns some results outside of the date window. As of today (10/18/20) it should ONLY return...
- 5 years ago
Hi,
You should have a Calendar Table with a relationship to the invoice date column. To your visual, drag Date from the Calendar Table. Write this measure
30-59 OVERDUE Balances = CALCULATE(SUM('ACCOUNTS_PAYABLE'[INVOICE_AMOUNT]),ACCOUNTS_PAYABLE[Unpaid?] in {"Unpaid"},DATESBETWEEN(Calendar[DATE], TODAY()-59, TODAY()-30) )Hope this helps.
Syndicate_Admin
5 years agoAdministrator
super
so that a 0 comes out in case there is no data I have completed it with
var _min = today()-365
var _max = today()
VAR Abiertos365 =
CALCULATE(...
...
)
RETURN
IF(ISBLANK(Abiertos365),0, Abiertos365)
Ashish_Mathur
5 years agoSuper User
Hi,
You may try this measure
=coalesce([Abiertos365],0)
Hope this helps.