Forum Discussion
Calculate Footfall values from opening date
- 4 years ago
Hi alexcatala ,
Please try the following formula:
Footfall (D) = VAR BoP_Date_Fixed = [BoP Date] VAR d_StoresAuto_Enriched = ADDCOLUMNS ( d_StoresAuto, "Include", MAX ( [COMP_Active] * ( [OpeningDateAniversary] <= BoP_Date_Fixed ), [NEW_Active] * ( [OpeningDateAniversary] > BoP_Date_Fixed ) ) ) VAR d_StoresAuto_Enriched_Filtered = FILTER ( d_StoresAuto_Enriched, [Include] = 1 ) VAR Result = SUMX ( d_StoresAuto_Enriched_Filtered, CALCULATE ( SUM ( 'f_DailyFootfall'[Traffic]), FILTER('d_StoresAuto','d_StoresAuto'[Date] >= 'd_StoresAuto'[OpeningDate]) ) ) RETURN IF ( Result = 0, [ND_Sign], Result )If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have tried your suggestion but it didn't work
It keeps showing the value before the opening date.
Hi alexcatala ,
Please try the following formula:
Footfall (D) =
VAR BoP_Date_Fixed = [BoP Date]
VAR d_StoresAuto_Enriched =
ADDCOLUMNS (
d_StoresAuto,
"Include", MAX (
[COMP_Active] * ( [OpeningDateAniversary] <= BoP_Date_Fixed ),
[NEW_Active] * ( [OpeningDateAniversary] > BoP_Date_Fixed )
)
)
VAR d_StoresAuto_Enriched_Filtered =
FILTER ( d_StoresAuto_Enriched, [Include] = 1 )
VAR Result =
SUMX (
d_StoresAuto_Enriched_Filtered,
CALCULATE ( SUM ( 'f_DailyFootfall'[Traffic]), FILTER('d_StoresAuto','d_StoresAuto'[Date] >= 'd_StoresAuto'[OpeningDate]) )
)
RETURN
IF ( Result = 0, [ND_Sign], Result )
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.