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.
I'm trying to age certain dollar amounts based on the due date of the invoice.
I have a 'before' date filter in my report that runs the report 'as of' whatever is selected.
Let's say I run the report as of 11/06/2020, I want to calculate the Balance Last 30 Days based on the date selected in the filter. I essentially want to sum the dollar amounts on all transactions that have a due date less than 11/06/2020 and greater than 10/05/2020. Here is the calculation I currently have:
Solved! Go to Solution.
@alexricker0928 DATEADD is a table function and in the first argument it expects a list of dates, if for some reasons you had to go by your way you have to wrap it inside curly braces { CurrentDate }
try if this works:
CT Balance Last 30 Days =
VAR CurrentDate =
SELECTEDVALUE (
'DimDate-InvoiceDate'[Date],
MAX ( 'DimDate-InvoiceDate'[Date] )
)
RETURN
CALCULATE (
SUM ( OpenARPrepayments[AmountMST] ),
FILTER (
OpenARPrepayments,
OpenARPrepayments[DueDate] < CurrentDate
&& OpenARPrepayments[DueDate] > CurrentDate - 30
)
)
@alexricker0928 DATEADD is a table function and in the first argument it expects a list of dates, if for some reasons you had to go by your way you have to wrap it inside curly braces { CurrentDate }
try if this works:
CT Balance Last 30 Days =
VAR CurrentDate =
SELECTEDVALUE (
'DimDate-InvoiceDate'[Date],
MAX ( 'DimDate-InvoiceDate'[Date] )
)
RETURN
CALCULATE (
SUM ( OpenARPrepayments[AmountMST] ),
FILTER (
OpenARPrepayments,
OpenARPrepayments[DueDate] < CurrentDate
&& OpenARPrepayments[DueDate] > CurrentDate - 30
)
)
What if the situation requires the filter to be "CurrentDate - 1 Quarter". What can you do then? (different quarter has different number of days)
thank you!
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |