Forum Discussion
wrong total
Hello,
my total for "Lost_amount" is shown as average instead of a summary.
It is a measure:
Anonymous
Still can be addef to the SUMMARIZE table
Lost_new =SUMX (SUMMARIZE('6_Lost''6_Lost'[StartDate],'6_Lost'[EndDate],'6_Lost'[Product],'6_Lost'[CYname],'Date'[Jahr],
'Date'[Monat]),
13 Replies
- tamerj1Community Champion
Hi Anonymous
please try
Lost_amount =
SUMX (
SUMMARIZE (
'6_Lost',
'6_Lost'[StartDate],
'6_Lost'[EndDate],
'6_Lost'[Product],
'6_Lost'[CYname]
),
CALCULATE (
VAR Purchase =
CALCULATETABLE (
VALUES ( '6_Lost'[Key] ),
FILTER (
ALL ( 'Date' ),
'Date'[Date]
>= MIN ( 'Date'[Date] ) - 'Month'[Month Value] * 30
&& 'Date'[Date] <= MAX ( 'Date'[Date] )
)
)
VAR _Current =
CALCULATETABLE (
VALUES ( '6_Lost'[Key] ),
FILTER (
ALL ( 'Date' ),
'Date'[Date] >= MIN ( 'Date'[Date] )
&& 'Date'[Date] <= CALCULATE ( [Min], 'Date'[Date] )
)
)
RETURN
CALCULATE (
CALCULATE (
'6_Lost'[Last_Sales],
DATESBETWEEN (
'Date'[Date],
MIN ( 'Date'[Date] ) - 'Month'[Month Value] * 30,
MIN ( 'Date'[Date] )
)
),
EXCEPT ( Purchase, _Current )
)
)
)- AnonymousNot applicable
Hi,
thanks for your help. I have tried it and add another column "Lost_new", but it seems to be empty 😞
- tamerj1Community Champion
Anonymous
Can you please share the code that you have used? What columns are placed in the table visual?