Hi Specialists
I have a report which have given me quite a headache. I can't fint out hov to make a cumulative total of Period for the previous year.
We have a contract that runs from april to march.So "april is month 1" and "march next year is month 12". I have made this in my date table.
I i for an example have chosen to see month 1 to 8, using slicers. So that would mean my table should show comsumption from april 2013 to november 2013. and for previous year it would be april 2012 to november 2012.
I have made the columns consumption "last year" "this year" "Total this year" "Total last year". Please se screendump below - sorry for the danish headers.
I cannot get the field "Total last year" to add up correctly.
The formula/measure fot Last year is "=CALCULATE(SUM(Sagsposter[Forbrug]);DATEADD(Dato[Dato];-1;year))
The measure for the Total Current year is (which works):
CALCULATE(
SUM(Sagsposter[Forbrug]);
filter(
allSELECTED(Dato);
Dato[Bu måned] <= MAX(Dato[Bu måned]))
)
Can anyone help me with findind the formula for the Total last year?
Example of what i tried:
=CALCULATE(
SUM(Sagsposter[Forbrug]);
filter(allSELECTED(Dato);DATEADD(Dato[Dato];-1;year));
filter(
allSELECTED(Dato);
Dato[Bu måned] <= MAX(Dato[Bu måned]))
)
I have tried parralleperiods. But i just cant get it to add up correctly.
I have tried for two days now and my hair is turning gray.
Any help appreciated.
Best regards
Rasmus
I have a report which have given me quite a headache. I can't fint out hov to make a cumulative total of Period for the previous year.
We have a contract that runs from april to march.So "april is month 1" and "march next year is month 12". I have made this in my date table.
I i for an example have chosen to see month 1 to 8, using slicers. So that would mean my table should show comsumption from april 2013 to november 2013. and for previous year it would be april 2012 to november 2012.
I have made the columns consumption "last year" "this year" "Total this year" "Total last year". Please se screendump below - sorry for the danish headers.
I cannot get the field "Total last year" to add up correctly.
The formula/measure fot Last year is "=CALCULATE(SUM(Sagsposter[Forbrug]);DATEADD(Dato[Dato];-1;year))
The measure for the Total Current year is (which works):
CALCULATE(
SUM(Sagsposter[Forbrug]);
filter(
allSELECTED(Dato);
Dato[Bu måned] <= MAX(Dato[Bu måned]))
)
Can anyone help me with findind the formula for the Total last year?
Example of what i tried:
=CALCULATE(
SUM(Sagsposter[Forbrug]);
filter(allSELECTED(Dato);DATEADD(Dato[Dato];-1;year));
filter(
allSELECTED(Dato);
Dato[Bu måned] <= MAX(Dato[Bu måned]))
)
I have tried parralleperiods. But i just cant get it to add up correctly.
I have tried for two days now and my hair is turning gray.
Any help appreciated.
Best regards
Rasmus
Last edited by a moderator: