I'm using the following method from Imke to produce a nicely formatted pivot table in Excel: https://www.thebiccountant.com/2016...ount-scheme-reports-power-bi-power-pivot-dax/
However, I am building on this to produce projected numbers.
For each reporting heading the user can choose to use a YTD average for the remaining periods or the latest month for each of the remaining periods.
The first measure is the same as Imke's post:
Amt_ :=
CALCULATE ( [Amt], AccountsAllocation )
The next measure uses the selected projection method to work out how much is to be applied to each future period:
BasisMonth :=
IF (
MIN ( ReportsAccountsLayout[Level] ) > 0,
BLANK (),
IF (
[pBasis] = "YTD Average",
[Amt_]
/ (
MAX ( CurrentPeriod[CurrentPeriod] )
- TRUNC ( MAX ( CurrentPeriod[CurrentPeriod] ) / 100 ) * 100
),
CALCULATE (
[Amt_],
FactActuals[Period] = VALUES ( CurrentPeriod[CurrentPeriod] )
)
)
)
For October CurrentPeriod[CurrentPeriod] would be 202007. The financial year starts in April.
And finally, the basismonth is multiplied by the number of remaining periods:
ProjectedActual :=
[BasisMonth]
* (
12
- (
MAX ( CurrentPeriod[CurrentPeriod] )
- TRUNC ( MAX ( CurrentPeriod[CurrentPeriod] ) / 100 ) * 100
)
)
At the moment subtotals are returning blanks (Bold in BasisMonth measure above) because I have no idea how to return the correct result.
Is anyone able to help?
However, I am building on this to produce projected numbers.
For each reporting heading the user can choose to use a YTD average for the remaining periods or the latest month for each of the remaining periods.
The first measure is the same as Imke's post:
Amt_ :=
CALCULATE ( [Amt], AccountsAllocation )
The next measure uses the selected projection method to work out how much is to be applied to each future period:
BasisMonth :=
IF (
MIN ( ReportsAccountsLayout[Level] ) > 0,
BLANK (),
IF (
[pBasis] = "YTD Average",
[Amt_]
/ (
MAX ( CurrentPeriod[CurrentPeriod] )
- TRUNC ( MAX ( CurrentPeriod[CurrentPeriod] ) / 100 ) * 100
),
CALCULATE (
[Amt_],
FactActuals[Period] = VALUES ( CurrentPeriod[CurrentPeriod] )
)
)
)
For October CurrentPeriod[CurrentPeriod] would be 202007. The financial year starts in April.
And finally, the basismonth is multiplied by the number of remaining periods:
ProjectedActual :=
[BasisMonth]
* (
12
- (
MAX ( CurrentPeriod[CurrentPeriod] )
- TRUNC ( MAX ( CurrentPeriod[CurrentPeriod] ) / 100 ) * 100
)
)
At the moment subtotals are returning blanks (Bold in BasisMonth measure above) because I have no idea how to return the correct result.
Is anyone able to help?
Last edited: