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

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
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.