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

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
Employee
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
Employee
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
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.