Hi,
I seem to have an issue with the overall totals in my forecasting table. It doesn’t display the the correct total. I have followed the tutorials around this and reviewed other posts in the forum but can’t seem see what the issue is. It seems to exclude FY2022 figures completely in the overall total.
Forecast Calc =
VAR Tot_1_Day_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -1, DAY ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
VAR Tot_3_Day_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -3, DAY ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
VAR Tot_7_Day_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -7, DAY ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
VAR Tot_28_Day_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -28, DAY ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
VAR Tot_1_Month_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -1, MONTH ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
VAR Tot_3_Month_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -3, MONTH ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
VAR Tot_6_Month_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -6, MONTH ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
VAR Tot_1_Year_P_Rev =
SUMX (
CALCULATETABLE (
'CTL CommPay',
DATEADD ( Dates[Date], -1, YEAR ),
ALL ( 'CTL CommPay'[PaymentPeriod] )
),
'CTL CommPay'[AmountGross]
)
RETURN
( Tot_1_Day_P_Rev + Tot_3_Day_P_Rev + Tot_7_Day_P_Rev + Tot_28_Day_P_Rev + Tot_1_Month_P_Rev + Tot_3_Month_P_Rev + Tot_6_Month_P_Rev + Tot_1_Year_P_Rev )
/ (
IF ( ISBLANK ( Tot_1_Day_P_Rev ), 0, 1 )
+ IF ( ISBLANK ( Tot_3_Day_P_Rev ), 0, 1 )
+ IF ( ISBLANK ( Tot_7_Day_P_Rev ), 0, 1 )
+ IF ( ISBLANK ( Tot_28_Day_P_Rev ), 0, 1 )
+ IF ( ISBLANK ( Tot_1_Month_P_Rev ), 0, 1 )
+ IF ( ISBLANK ( Tot_3_Month_P_Rev ), 0, 1 )
+ IF ( ISBLANK ( Tot_6_Month_P_Rev ), 0, 1 )
+ IF ( ISBLANK ( Tot_1_Year_P_Rev ), 0, 1 )
)
Summarized Forecast =
SUMX (
SUMMARIZE ( Dates, Dates[Date], “Summ Forecast”, [Forecast Calc] ),
[Summ Forecast]
)
Forecast =
SWITCH (
TRUE (),
ISBLANK ( [Total Gross CommPay RR] ) = TRUE (), [Summarized Forecast],
TRUE (), [Forecast Calc]
)
Total Gross CommPay RR =
SUM ( 'CTL CommPay'[AmountGross] )
Thanks