cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
s-yarosh Frequent Visitor
Frequent Visitor

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

Accepted Solutions
v-ljerr-msft Super Contributor
Super Contributor

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

Hi @s-yarosh,

 

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

3 REPLIES 3
s-yarosh Frequent Visitor
Frequent Visitor

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

Here is the file with this measures:

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

 

Any help is appreciated.

 

Thanks!

v-ljerr-msft Super Contributor
Super Contributor

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

Hi @s-yarosh,

 

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

s-yarosh Frequent Visitor
Frequent Visitor

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

ooh, now I see, that was simple.

Thanks a lot, @v-ljerr-msft!