Forum Discussion
Hemant_Jaiswar
1 year agoHelper I
aggregation at customer name level
desired output Month Total 2023 Total 2024 LFL 2023 LFL 2024 Jan 20 35 20 27 Feb 21 31 21 22 Mar 20 37 20 28 Apr 32 33 12 33 Goal: Total 2023: Sum the...
Anonymous
1 year agoNot applicable
Hi Hemant_Jaiswar ,
I want to acknowledge valuable input provided by Kedar_Pande . Their initial ideas help guide my approach. However, I noticed that more details are needed to fully understand this issue.
(1) Create a column.
Flag = IF([2023 Sales]<>BLANK() && [2024 Sales]<> BLANK(),1,0)
(2) Then create a new table.
Table 2 =
ADDCOLUMNS (
VALUES ( 'Table'[Month] ),
"Total 2023",
CALCULATE (
SUM ( 'Table'[2023 Sales] ),
FILTER ( 'Table', 'Table'[Month] = EARLIER ( 'Table'[Month] ) )
),
"Total 2024",
CALCULATE (
SUM ( 'Table'[2024 Sales] ),
FILTER ( 'Table', 'Table'[Month] = EARLIER ( 'Table'[Month] ) )
),
"LFL 2023",
CALCULATE (
SUM ( 'Table'[2023 Sales] ),
FILTER ( 'Table', [Flag] = 1 && 'Table'[Month] = EARLIER ( 'Table'[Month] ) )
),
"LFL 2024",
CALCULATE (
SUM ( 'Table'[2024 Sales] ),
FILTER ( 'Table', [Flag] = 1 && 'Table'[Month] = EARLIER ( 'Table'[Month] ) )
)
)
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.