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

YTD Year-over-Year in column chart

Hello,

I have the following table and i am trying to show in a clustered column chart the YTD total items by month, for year over year. Is it possible?

I managed to show the current YTD with the previous YTD only using the following formula in a measure. But i am not able to show for the YTD for years prior to last year on the same chart. 

 

 

Same Period Last Year = 
CALCULATE(
            sum(Table1[Items]),
            SAMEPERIODLASTYEAR('Date'[Date])
        )

 

In this case, for each month-year on the X-axis of the clustered column chart, it should have 3 columns (YTD for 2020, 2021 and 2022). Any help is much appreciated!

 

DateItems
27/01/20203
28/02/20206
29/03/20209
01/04/202012
02/06/20208
05/10/20202
06/12/20203
03/01/20213
05/01/20217
03/02/20216
04/03/20212
04/04/20219
04/05/20215
04/05/20212
05/06/20214
01/07/20217
04/08/20218
04/09/20218
06/10/20214
15/10/20216
09/11/20213
11/12/20212
13/12/202110
05/01/20224
06/01/202212
27/02/20223
28/02/20223
01/03/202211
02/03/20227
04/04/20228
04/04/20225
09/04/20223
06/05/20223
09/05/20223
05/06/20222
11/06/20225
06/07/20229
13/08/20221
15/08/20226

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Ashish_Mathur, thanks for your reply! But i think there is a problem with the measures. As below, the values for January is correct but the other months are not correct. For example, in February, all 3 years (3 columns) should each have value = 6. For March, the values should be 9 (2020), 2 (2021) and 18 (2022). The Items column is a good reference to the correct total for each month in each year. Any idea on how to fix it?

 

MakeItReal_0-1658632220524.png

 

You are welcome.  That result seems correct to me.  In January and February 2021, the items were 10 and 6.  There in YTD Feb 2021, the figure should be 16.  What is the mistake?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur I'm sorry if i didn't make it clear earlier, but i am looking for a graph where the data is shown by month on the X-axis and there should be 3 bars for each month, which groups only the data for that month and the corresponding year for 2020, 2021 and 2022. I think your solution is a running total by month for each year.

 

For example (month: 2020, 2021, 2022):

January: 3, 10, 16

February: 6, 6, 6

March: 9, 2, 18

April: 12, 9, 16

...

December: 3, 12, 0

 

Is that possible?

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.