Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

LY YTD specific

Hi 

 

I am trying to get number of meetings YTD and LY YTD for a metrix where I have countries on the row. 

 

Total meetings = SUM('meetings'[meetings count])

 Total meetings YTD = CALCULATE([Total meetings], DATESBETWEEN('meetings'[Created Date],"1/1/2017",TODAY())

 - i am using this because there are dates in the future (planed meetings)

Total meetings LY YTD = ???

 

I was thinking to use the DATEADD(DATESBETWEEN('meetings'[Created Date],"1/1/2017",TODAY()),-1,Year) but obviously that doesnt work...

or even mor complicated idea :) =  DATESBETWEEN('meetings'[Created Date],"1/1/2017",DATEADD(TODAY()),-1,Year) which is even bigger nonsense but i am running out of ideas here.. as I tried same period last year 

 

 

 anyone with suggestion?

 

Thank you 

 

 


  • Anonymous wrote:

    Hi 

     

    I am trying to get number of meetings YTD and LY YTD for a metrix where I have countries on the row. 

     

    Total meetings = SUM('meetings'[meetings count])

     Total meetings YTD = CALCULATE([Total meetings], DATESBETWEEN('meetings'[Created Date],"1/1/2017",TODAY())

     - i am using this because there are dates in the future (planed meetings)

    Total meetings LY YTD = ???

     

    I was thinking to use the DATEADD(DATESBETWEEN('meetings'[Created Date],"1/1/2017",TODAY()),-1,Year) but obviously that doesnt work...

    or even mor complicated idea :) =  DATESBETWEEN('meetings'[Created Date],"1/1/2017",DATEADD(TODAY()),-1,Year) which is even bigger nonsense but i am running out of ideas here.. as I tried same period last year 

     

     

     anyone with suggestion?

     

    Thank you 

     

     


    Anonymous

    Roughly, you could try

    Total meetings LY YTD =
    CALCULATE (
        [Total meetings],
        DATESBETWEEN (
            'meetings'[Created Date],
            DATE ( YEAR ( TODAY () ) - 1, 1, 1 ),
            DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), DAY ( TODAY () ) )
        )
    )

4 Replies

  • SivaMani's avatar
    SivaMani
    Icon for Resident Rockstar rankResident Rockstar

    Anonymous,

     

    It would be easy help you if you share some sample data

  • Eric_Zhang's avatar
    Eric_Zhang
    Icon for Microsoft Employee rankMicrosoft Employee

    Anonymous wrote:

    Hi 

     

    I am trying to get number of meetings YTD and LY YTD for a metrix where I have countries on the row. 

     

    Total meetings = SUM('meetings'[meetings count])

     Total meetings YTD = CALCULATE([Total meetings], DATESBETWEEN('meetings'[Created Date],"1/1/2017",TODAY())

     - i am using this because there are dates in the future (planed meetings)

    Total meetings LY YTD = ???

     

    I was thinking to use the DATEADD(DATESBETWEEN('meetings'[Created Date],"1/1/2017",TODAY()),-1,Year) but obviously that doesnt work...

    or even mor complicated idea :) =  DATESBETWEEN('meetings'[Created Date],"1/1/2017",DATEADD(TODAY()),-1,Year) which is even bigger nonsense but i am running out of ideas here.. as I tried same period last year 

     

     

     anyone with suggestion?

     

    Thank you 

     

     


    Anonymous

    Roughly, you could try

    Total meetings LY YTD =
    CALCULATE (
        [Total meetings],
        DATESBETWEEN (
            'meetings'[Created Date],
            DATE ( YEAR ( TODAY () ) - 1, 1, 1 ),
            DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), DAY ( TODAY () ) )
        )
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      HI   Eric_Zhang

       

      That formula works great in matrix or table but when I want to add it to line graph for the YTD LY i get flat line 

      What should I add so it will display also the LY YTD correctly. on my Axis of the line graph i have months

       

      Thank you