 # Time intelligence SUM of production dates for exactly one month

This is my code:

``````SUM Production each Month =
SUMX(
FILTER(ALL(Datum[Datum]),
Datum[Datum]> MAX(Datum[Datum])-30 &&
Datum[Datum]<= MAX(Datum[Datum])),
[Total Production Bleach Plant])
``````

The problem here is that I want exactly the amount of production for each month (which differs for sure between 30 und 31 days).

How can I implement this fact into my formular?

Thank’s Lukas

Hi @Lukas , Welcome to the EDNA community and great to have you here.
For the accurate solution please make sure to attach your PBIX file also. However, you can try this measure:

Production Each Month =
CALCULATE ( [Total Production Beach Plant],
DATESMTD (Date [Date]) // Your continuous Date Column

The formula varies and it depends upon the type of visual you are looking for. If this doesn’t work then please share your PBIX file.

Thanks.

@Lukas Try something like this:

``````=
VAR CurrentMonth =
MAX ( Dates[Month Number] )
VAR CurrentMonthFirstDate =
CALCULATE (
MIN ( Dates[Date] ),
Dates[Month Number] = CurrentMonth,
REMOVEFILTERS ( Dates )
)
VAR CurrentMonthLastDate =
CALCULATE (
MAX ( Dates[Date] ),
Dates[Month Number] = CurrentMonth,
REMOVEFILTERS ( Dates )
)
VAR DateList =
FILTER (
ALL ( Dates ),
Dates[Date] >= CurrentMonthFirstDate
&& Dates[Date] <= CurrentMonthLastDate
)
VAR Result =
CALCULATE ( [Total Production], DateList )
RETURN
Result``````
1 Like

Thank you Antriksh Sharma!

Enclosed you will find the results in table one.

At the time, the results of your formular are showing (I think) the average daily production e.g. 1156,35 t/d.
The column “SUM Production each Month” is still the original formular.

How can I now get to the correct monthly based total production (30 or 31 days)?

Thanks a lot!

BR Lukas