Forum Discussion
Anonymous
7 years agoNot applicable
Fill a column based on last month date
Hello! I need to create a calulated column "NEW COLUM", placing the last month values acording to the "tipe" column, and olny the last month f.e I had 2700000 kg of CPRS in January, i need the...
- 7 years ago
Try like this:
= CALCULATE(
SUM( 'Table'[kGS] ),
ALLEXCEPT( 'Table', 'Table'[Type] ),
'Table'[Month] = EARLIER( 'Table'[Month] ) - 1
)
edhans
Community Champion
7 years agoYou'll need a date table to do this properly. Then the following measure will give you the previous month sales. The filter context of the table/matrix will keep it to just items of the same Type.
=CALCULATE(
[Total Sales],
PREVIOUSMONTH('Calendar'[Date])
)