Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a problem while constructing a cummulative sum chart for a comparison with a target&previous period numbers.
I have defined revenue as:
Total Revenue DK = Calculate(sum(Orders[SubTotal]), some irrelevant filters here)
then the previous year's revenue:
Prev Year Revenue DK = CALCULATE([Total Revenue DK], SAMEPERIODLASTYEAR('Calendar'[Date]))
and then I proceeded to create the running total of previous year's revenue:
Prev Year Revenue DK RT =
CALCULATE(
[Prev Year Revenue DK],
FILTER(
ALLSELECTED('Calendar'[Date]),
'Calendar'[Date] <= MAX('Calendar'[Date])
)
)
Here's the issue with that:
the today's number (18/11/2021 in this case) for a corresponding last year's running total is literally the total sum of the whole current month - hence the sudden rise.
The chart filtering is set for the current month.
What should I do in this case?
Hi, @mba
Not sure if it’s a problem with time intelligence functions.
You can try:
Prev Year Revenue DK = CALCULATE([Total Revenue DK], DATEADD('Calendar'[Date], -1, year))
Not clear about your visual context.
You can try:
Prev Year Revenue DK RT =
CALCULATE(
[Prev Year Revenue DK],
FILTER(
ALL('Calendar'[Date]),
'Calendar'[Date] <= MAX('Calendar'[Date])
)
)
You can also try to merge there measures to one measure.
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Community Support Team _ Janey
@mba , Assume you have cumm measure
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))
year behind cumm
Cumm Sales Tr 1 = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=maxx(date,dateadd(date[date]),-1,year)))
According to your advice, I changed it to:
Prev Year Revenue DK - RT =
CALCULATE(
[Total Revenue DK],
FILTER(
ALLSELECTED('Calendar'[Date]),
'Calendar'[Date] <= MAXX('Calendar', DATEADD('Calendar'[Date], -1, YEAR))
)
)
... but now the values are completely missing:
It is due to the fact that dateadd() put it back one year, so there's no way that it is higher than current date. Hence no values.
PS. It's all on the same graph as these from current year.
@mba Any updates?
I haven't received your reply and don't know your current situation.
If you still need help, please feel free to ask me.
Best Regards,
Community Support Team _ Janey
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |