cancel
Showing results for
Did you mean:
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:

Best regards,

Sasha

1 ACCEPTED SOLUTION

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

All the three measures work correctly like below.

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.

Regards

3 REPLIES 3
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!

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.

All the three measures work correctly like below.

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.

Regards

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!

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 301 members 3,087 guests
Recent signins: