Forum Discussion

DavidEg's avatar
DavidEg
Frequent Visitor
5 years ago
Solved

SAMEPERIODLASTYEAR with previous date filter

Hi,   I have a table tickets, with two dates. Opening Date and solution Date. I relate them through a calendar table.   N_TicketsOpening = CALCULATE (COUNT (CCBI_vwTickets [TicketId]), CCBI_vwT...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi DavidEg 

    My Sample:

    I add YearMonth into Page filter and select 202101 and 202112.

    Please try my measure:

    N_TicketsOpening_LY = 
    VAR _CurYear = YEAR(MAX(CCBI_vwTickets[OpeningDate]))
    Return
    CALCULATE(COUNT(CCBI_vwTickets[TicketId]),FILTER(ALL(CCBI_vwTickets),YEAR(CCBI_vwTickets[OpeningDate])=_CurYear-1))

    Result is as below.

    If this reply still couldn't help you solve your problem, please show me a sample like what you are dealing with by your Onedrive for Business.

    This will make it easier for me to understand your requirement.

     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.