Forum Discussion
Adding previous month measure
Hello lbendlin ,
Thanks for your thought, I understand what you are saying.
Let's do it this way:
I have a formula that calculates the resolved tickets.
total_tickets_solved =
COUNTROWS(
FILTER(
tickets,
RELATED('status'[description]) = "Completed"
)
)This formula works smoothly as you can see.
Now my next step is to calculate the number of solved tickets for the previous month. So adding the metric that already works and invoking the previous month function, the formula would be this:
tmp =
CALCULATE(
[total_tickets_solved],
PREVIOUSMONTH('calendar'[date])
)
But it does not work, the result returns blank.
So in my understanding this means that the problem is in the relationship between the ticket table and the calendar table.
Any suggestions to confirm what I think?
Thanks for any comments.
total_tickets_solved =
COUNTROWS(
FILTER(
tickets,
RELATED('status'[description]) = "Completed"
)
)
RELATED has no place in a measure. The relationship is implied through the data model.
total_tickets_solved =
CALCULATE(COUNTROWS(tickets),
'status'[description] = "Completed"
)
In addition you should try and avoid filtering entire tables. Filter columns when possible.
- ajdm20071 year ago
Helper III
This is my goal:
I have already the Total Tickets Solved one.
So, based on your last insight, what should the measure's formula be?
Thank you so much for your support.