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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Running Total YTD - Different reflection for matrix and bar/line charts

Hello, 

  

I was trying to calculate YTD running total with few different approaches:

 

1) YTDCalculate = CALCULATE( SUM( Repairs[Repairs]), FILTER ( ALL ( 'Calendar'[Date] ), 'Calendar'[Date] <= MAX ( Repairs[Date] )))

2) YTDCalculate2 = IF ( MIN ( 'Calendar'[Date] ) <= CALCULATE ( MAX (Repairs[Date]), ALL ( Repairs ) ), CALCULATE ( SUM ( Repairs[Repairs] ), FILTER ( ALL ( 'Calendar'[Date] ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) ) )

3) YTDtotalYTD = TOTALYTD(sum(Repairs[Repairs]),'Calendar'[Date])

 

All of them provide correct expected output if I display them in table form, but if I try to make a line/bar chart it became very confusing:

1) YTDCalculate - works fine, as needed

2) YTDCalculate2 - for some reason only totals shown

3) YTDtotalYTD - ignored, not recognised by line/bar charts

 

Could somebody please clarify on this? Why the behaviour of these calculations are different in table and line/bar chart?
Why TOTALYTD is not recognised in line/bar chart?
If any of these formulas needs improvement - your help would be very appreciated.

 

Here is the screenshot:

YTD measures2.png 

Thanks a lot in advance!

 

Best regards, 

Sasha

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

After looking into the shared pbix file and doing a few tests on it, I find that all the three measures can work correctly if we don't select the double arrow directly, and enable drill down first by selecting the arrow icon in the top right corner of the chart, then click on the data column on the chart to select a year to drill down.

 

s1.PNG

 

All the three measures work correctly like below.

 

 s2.PNG

 

If we simply select the double arrow, only the first measure works fine. That's because the measures will be evaluated under context of each month of all the years(2015-2018) in this scenario, as we didn't select a specific Year to drill down. So only the first measure works fine.

 

 s0.PNG

s5.PNG 

 

Regards

View solution in original post

3 REPLIES 3
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

After looking into the shared pbix file and doing a few tests on it, I find that all the three measures can work correctly if we don't select the double arrow directly, and enable drill down first by selecting the arrow icon in the top right corner of the chart, then click on the data column on the chart to select a year to drill down.

 

s1.PNG

 

All the three measures work correctly like below.

 

 s2.PNG

 

If we simply select the double arrow, only the first measure works fine. That's because the measures will be evaluated under context of each month of all the years(2015-2018) in this scenario, as we didn't select a specific Year to drill down. So only the first measure works fine.

 

 s0.PNG

s5.PNG 

 

Regards

Anonymous
Not applicable

ooh, now I see, that was simple.

Thanks a lot, @v-ljerr-msft!

Anonymous
Not applicable

Here is the file with this measures:

https://1drv.ms/u/s!Al5wGdutBKRWgn3p2GvYlaZNA6qv

 

Any help is appreciated.

 

Thanks!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.