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
 

mole999

Moderator
Joined
Oct 23, 2004
Messages
9,879
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

Moderator
Joined
Oct 23, 2004
Messages
9,879
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
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

Moderator
Joined
Oct 23, 2004
Messages
9,879
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,078,393
Messages
5,339,926
Members
399,340
Latest member
JasonT903

Some videos you may like

This Week's Hot Topics

Top