I need a correct formula for calculating accruals and I hope a finance type has something ready-made as this ties me in knots. (I think everyone hates accrual accounting.)
We calculate accruals in a somewhat normal accounting way. If I order a $100 widget from Zimmer, we put it on a department's balance sheet as an accrual when we receive it. It then stays as an accrual until we receive a (correct) invoice, at which time we change it to an actual expense. So, if I order the widget on Feb 20, it is received on Feb 26, and we receive the invoice on April 03, the department's balance sheet will show for that 1 widget:
February: +$100 (accrual)
March: -$100 for February, +$100 for March
April: -$100 accrual for March, +$100 expense for April
May: $0 (was paid in April)
The tables are arranged such that Orders is 1:many to both Receipts and Vouchers
Order Calendar (Date Table using Order Date) 1:many to Orders
Orders 1:many to Receipts
Orders 1:many to Vouchers
AP Calendar (Date Table) 1:many to Vouchers
For simplicity I created columns in the Receipts table so that I have both the Order Amount (e.g. $100) and the Invoice Received Date from the Voucher file. In the above example then the Order #123 would show values in the linked Receipts table Receipts[PO Amount] = $100, Receipts[Recv Date] = 2/26/19, and the Receipts[Vchr Recv Date] = 4/03/19.
I need a formula that will return that $100 for each time period that the widget was received but not invoiced. A monthly report would look like
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Feb 2019[/TD]
[TD]Mar 2019[/TD]
[TD]Apr 2019[/TD]
[TD]May 2019[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]ZIMMER[/TD]
[TD]$100[/TD]
[TD]$100[/TD]
[TD]$100[/TD]
[TD]$0[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
And a daily report would have that $100 for each day from Feb 26 through April 03.
So here is where I get confused in how to construct a proper date measure. Since I want to count the Receipts[PO Amount] for each time period I used the AP Calendar table as a disconnected date table.
I *think* this is correct - but counterintuitively the clause -- Receipts[Vchr Recv Date] <= MAX('AP Calendar'[Date]) -- returns a higher number than using >=, even though the logic is saying only sum the amount if the receipt and invoice arrived in the same time period which is not what I want.
For my pivot table duplicating the $100 report format above I am also unsure what I am reporting if I use the Order Calendar date field in the Columns section and filter on 2019. Since the Order Calendar is related to the Orders, if I filter from February to June I am grouping the POs that were Ordered in each of those months. But, do I need an additional timeline so that I am relating the AP Calendar (on which the measure is based) to some of the data? Otherwise, how does the pivot table "know" based on the order date whether the order accrued during that month as well? I get numbers for the above, but are they the right numbers?
We calculate accruals in a somewhat normal accounting way. If I order a $100 widget from Zimmer, we put it on a department's balance sheet as an accrual when we receive it. It then stays as an accrual until we receive a (correct) invoice, at which time we change it to an actual expense. So, if I order the widget on Feb 20, it is received on Feb 26, and we receive the invoice on April 03, the department's balance sheet will show for that 1 widget:
February: +$100 (accrual)
March: -$100 for February, +$100 for March
April: -$100 accrual for March, +$100 expense for April
May: $0 (was paid in April)
The tables are arranged such that Orders is 1:many to both Receipts and Vouchers
Order Calendar (Date Table using Order Date) 1:many to Orders
Orders 1:many to Receipts
Orders 1:many to Vouchers
AP Calendar (Date Table) 1:many to Vouchers
For simplicity I created columns in the Receipts table so that I have both the Order Amount (e.g. $100) and the Invoice Received Date from the Voucher file. In the above example then the Order #123 would show values in the linked Receipts table Receipts[PO Amount] = $100, Receipts[Recv Date] = 2/26/19, and the Receipts[Vchr Recv Date] = 4/03/19.
I need a formula that will return that $100 for each time period that the widget was received but not invoiced. A monthly report would look like
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Feb 2019[/TD]
[TD]Mar 2019[/TD]
[TD]Apr 2019[/TD]
[TD]May 2019[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]ZIMMER[/TD]
[TD]$100[/TD]
[TD]$100[/TD]
[TD]$100[/TD]
[TD]$0[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
And a daily report would have that $100 for each day from Feb 26 through April 03.
So here is where I get confused in how to construct a proper date measure. Since I want to count the Receipts[PO Amount] for each time period I used the AP Calendar table as a disconnected date table.
Code:
Accrual Amount:=
CALCULATE( SUM( Receipts[PO Amount] ),
FILTER(Receipts,
Receipts[Recv Date] >= MIN( 'AP Calendar'[Date])
&& Receipts[Vchr Recv Date] >= MAX('AP Calendar'[Date])
)
)
I *think* this is correct - but counterintuitively the clause -- Receipts[Vchr Recv Date] <= MAX('AP Calendar'[Date]) -- returns a higher number than using >=, even though the logic is saying only sum the amount if the receipt and invoice arrived in the same time period which is not what I want.
For my pivot table duplicating the $100 report format above I am also unsure what I am reporting if I use the Order Calendar date field in the Columns section and filter on 2019. Since the Order Calendar is related to the Orders, if I filter from February to June I am grouping the POs that were Ordered in each of those months. But, do I need an additional timeline so that I am relating the AP Calendar (on which the measure is based) to some of the data? Otherwise, how does the pivot table "know" based on the order date whether the order accrued during that month as well? I get numbers for the above, but are they the right numbers?