PDA

View Full Version : [SOLVED] Cumulative values by Date



werafa
06-03-2017, 12:09 AM
Hi all,

I am trying to implement the cumulative values measure in MS Power BI - (which is supposed to be the engine for Excel Power BI).

I have attempted to follow the tutorial on http://www.daxpatterns.com/cumulative-total/.
I've created and loaded a date table.

I've created a relationship between Datekey[date ] and PBI_KPIs[DateTo]

I've copied in the dax code



CumulativeGCI =
CALCULATE(
SUM(PBI_KPIs[GCI]),
FILTER(ALL(DateKey[Date]), DateKey[Date] <= MAX (DateKey[Date])
)
)


and the .... thing won't work.
can anyone spot my error?

thanks

werafa
06-03-2017, 12:18 AM
got it.

was bad syntax
correct DAX is



CumulativeGCI MEASURE =
CALCULATE(
SUM(PBI_KPIs[GCI]),
FILTER(ALL('DateKey'[Date]), 'DateKey'[Date] <= MAX ('DateKey'[Date])
)
)

xld
06-04-2017, 02:52 PM
Are you saying that it needs the apostrophes around the table name? That seems odd, it doesn't have any spaces within the name.

werafa
06-04-2017, 04:03 PM
Can't say I know how, why or what.....
I poked it and it moved

There is probably another explanation, and I shall eventually learn what it is

:)
Werafa