Consulting

Results 1 to 4 of 4

Thread: Cumulative values by Date

  1. #1
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location

    Cumulative values by Date

    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
    Remember: it is the second mouse that gets the cheese.....

  2. #2
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    got it.

    was bad syntax
    correct DAX is

    CumulativeGCI MEASURE = 
    CALCULATE(
    	SUM(PBI_KPIs[GCI]), 
    		FILTER(ALL('DateKey'[Date]), 'DateKey'[Date] <= MAX ('DateKey'[Date])
    		)
    )
    Remember: it is the second mouse that gets the cheese.....

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Are you saying that it needs the apostrophes around the table name? That seems odd, it doesn't have any spaces within the name.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    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
    Remember: it is the second mouse that gets the cheese.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •