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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
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)
 

DickyMoo

New Member
Joined
Mar 8, 2016
Messages
32
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.
 

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
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
 

DickyMoo

New Member
Joined
Mar 8, 2016
Messages
32

ADVERTISEMENT

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) ) )
 

DickyMoo

New Member
Joined
Mar 8, 2016
Messages
32
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???



 

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
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
 

Forum statistics

Threads
1,144,582
Messages
5,725,119
Members
422,590
Latest member
Mikeyyy

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
Top