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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Calculate Year to Date Year on Year Growth

Hi All,

 

I'm new to Power BI and just wanted to know how it is possible to create a year to date vs previous year bar chart. My source data is events data over the last few years - one record per event and multiple events per day. I can create a cluster bar chart that gives me a monthly comparison since the beginning of last year but alongside it i would like a chart that shows year to date comparison vs last year (based on the last full month).

 

Dummy data below as an example - summary by month and year (matrix) which can be plotted as a cluster bar and no additional manipulation to the source data required. The year to date figures will exclude the partial current month.

 

Month20182019 Period2018 YTD2019 YTD
Jan6191 Events441394
Feb8234    
Mar5024    
Apr194    
May5881    
Jun6225    
Jul8741    
Aug404    
Sep335    
Oct85     
Nov40     
Dec45     

 

Any ideas on how to proceed - do i need to create a separate summary table etc?

 

And as a separate question given my source data will be udpated every day how do i make both charts dynamic so i will only ever see the current year vs last year without having to hard code the years?

 

Thank You

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

we can try to use the following measure to meet your requirement.

 

ThisYear = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) )
)
LastYear = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) - 1 )
)

13.PNG14.PNG

 

 

BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

we can try to use the following measure to meet your requirement.

 

ThisYear = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) )
)
LastYear = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', 'Table'[Date].[Year] = YEAR ( TODAY () ) - 1 )
)

13.PNG14.PNG

 

 

BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.