TOTALYTD error

DickyMoo

New Member
Joined
Mar 8, 2016
Messages
32
Hi everyone,

I am using the below measures:

Sum of Amount - Actuals = CALCULATE( SUM(SUN[Amount]) , SUN[Ledger] = "A" )

YTD Actuals = IF( HASONEVALUE( 'Calendar'[Financial Year] ) , TOTALYTD( [Sum of Amount - Actuals] , 'Calendar'[Date] , "30/06" ) , 0 )

Pretty standard stuff.

However, I get some unusual behaviour when drilling through charts.

Our structure goes Department > Cost Centre. Everything is as expected at Department level, but when I drill to Cost Centre level some values are missing. Upon investigation the missing values are those that do not have a value in the month selected by slicer. But for those that do have a value in the current month, the values are summing correctly for the YTD.

If I select all months up to and inc. current month the problem is fixed, but this is not how I would like people to use the report.

Any ideas? Do I need to change my YTD measure to include FILTER(ALL(Dates ... ?

Thanks
Rich
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
i've had to add extra values of zero for each expected value, so I never have a null (and therefore the tables populate properly)
 
Upvote 0
Do you mean add these lines to the source data? I'm pulling from a SQL database so I'm not sure how to do that.

-- I should also have said above that the totals are correct, its just the individual Cost Centre lines that are wrong.
 
Upvote 0
i run some vba after the sql and add all the static ID and a value of zero, so if in a small data set it isn't available my zeros help the consistent modelling
 
Upvote 0
Ok, I might look at that as a longer term solution, something to add to the DW. Thank you.

I am getting the correct results with the below, but I'm confused, I thought TOTALYTD did the equivalent of this anyway...?

YTD Actuals TEST = CALCULATE([Sum of Amount - Actuals], FILTER(ALL('Calendar') , AND('Calendar'[Financial Year] = 2016 , 'Calendar'[Financial Month] <= 3) ) )
 
Upvote 0
Is the problem that with my first measure I'm filtering down to only those rows that have data in the current month (because of the month selected on the slicer) then applying the TOTALYTD to that filtered list???



 
Upvote 0
Is the problem that with my first measure I'm filtering down to only those rows that have data in the current month (because of the month selected on the slicer) then applying the TOTALYTD to that filtered list???



probably, but without playing with i'm not sure, if there is nothing to model. I'm familiar with pivots not powerBI
 
Upvote 0

Forum statistics

Threads
1,214,527
Messages
6,120,054
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top