Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

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 

 

 

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
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 () ) )
    )
)

View solution in original post

4 REPLIES 4
Eric_Zhang
Employee
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
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 

SivaMani
Resident Rockstar
Resident Rockstar

@Anonymous,

 

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

Anonymous
Not applicable

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.