Hi,
Hope someone will be able to help me,
I would like to sum rolling quarter in Power BI but there is one problem when using selector (for ex. If I have only two months in 2021 and select in slicer 2021 Rolling Quarter Sum only 2 months and my intention is to
- find max month for selection (in this Case Feb 2021) and sum past 3 months ignoring data filters (so Dec 2020+Jan+Feb)
I wrote something like this but id doesn't work properly
Rolling sum 3 months =
VAR LastDate_ =
LASTDATE ( Raporty_sprzedaz_dzienna[Data])
RETURN
CALCULATE (
sumx (VALUES (Raporty_sprzedaz_dzienna[Data]),CALCULATE ( SUM (Raporty_sprzedaz_dzienna[Value] ) ) ),
FILTER (
ALL ( Raporty_sprzedaz_dzienna[Data]),
Raporty_sprzedaz_dzienna[Data] <= LastDate_
&& Raporty_sprzedaz_dzienna[Data] > DATEADD ( LastDate_, -3, MONTH )
)
)
Kindly ask for some advice
Damian
Hope someone will be able to help me,
I would like to sum rolling quarter in Power BI but there is one problem when using selector (for ex. If I have only two months in 2021 and select in slicer 2021 Rolling Quarter Sum only 2 months and my intention is to
- find max month for selection (in this Case Feb 2021) and sum past 3 months ignoring data filters (so Dec 2020+Jan+Feb)
I wrote something like this but id doesn't work properly
Rolling sum 3 months =
VAR LastDate_ =
LASTDATE ( Raporty_sprzedaz_dzienna[Data])
RETURN
CALCULATE (
sumx (VALUES (Raporty_sprzedaz_dzienna[Data]),CALCULATE ( SUM (Raporty_sprzedaz_dzienna[Value] ) ) ),
FILTER (
ALL ( Raporty_sprzedaz_dzienna[Data]),
Raporty_sprzedaz_dzienna[Data] <= LastDate_
&& Raporty_sprzedaz_dzienna[Data] > DATEADD ( LastDate_, -3, MONTH )
)
)
Kindly ask for some advice
Damian