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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ksoukup
Helper I
Helper I

Monthly Values with YTD Running Total for Multiple Years

Hello,

 

This one is proving to be quite difficult! I am trying to show monthly weights for a three-year period, and would like a YTD running total line for each of the years on a secondary axis. I know I can do these as separate measures, but then the colors of the column and line will not match up, making it very confusing to look at.

 

Is there any way to accomplish this??

 

Below is the DAX I'm using for the Weight YTD line in the image, which is cumulating just the 2022 sales by month. The ideal outcome would be three separate YTD lines that color correspond to the same year in the column values.

 

Weight YTD =
CALCULATE(
    [Total Weight],
    DATESYTD('Dates Table'[Date],"31/12")
)

 

ksoukup_0-1675279874851.png

Thanks for looking.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ksoukup , In standard combo viusal,  line will not use legned

 

You may need additional measures like

 

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

2nd Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ksoukup , In standard combo viusal,  line will not use legned

 

You may need additional measures like

 

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

2nd Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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