Forum Discussion

Bart-ek's avatar
Bart-ek
Icon for Helper I rankHelper I
6 years ago
Solved

cumulative values without any time frame with separated lines for legend

I want to accumulate values over time without any time frame. I have visual created with single line but I can't make separate values for separate groups to be shown on the same chart (without creating separate measures per group/person as I'll never know exact number of people):

result I want to achieve something like this:

any idea how to solve it?

 

current value for cummulation:

 

tables (separate for calendar)

 

  • Hi Bart-ek ,

     

    try this

     

    cumulation of results = 
    VAR MaxDate = MAX('CALENDAR'[Date])
    RETURN
      CALCULATE(
        SUM(test[result in numbers]),
        FILTER(
          ALL(CALENDAR),
          'CALENDAR'[Date] <= MaxDate
        )
      )

     

     

    If I answered your question, please mark my post as solution, this will also help others.

    Please give Kudos for support.

  • actually found a solution myself too after I've placed this thread 😄 ... 

     

    all('CALENDAR')
    instead of 
    all('test')
     
    that brings this result:

4 Replies

  • mwegener's avatar
    mwegener
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hi Bart-ek ,

     

    try this

     

    cumulation of results = 
    VAR MaxDate = MAX('CALENDAR'[Date])
    RETURN
      CALCULATE(
        SUM(test[result in numbers]),
        FILTER(
          ALL(CALENDAR),
          'CALENDAR'[Date] <= MaxDate
        )
      )

     

     

    If I answered your question, please mark my post as solution, this will also help others.

    Please give Kudos for support.

  • Hi Bart-ek,

    Place the name column on the legend and change your all part of the measure for the date column instead of the all test table.

    Regards,
    MFelix
    • Bart-ek's avatar
      Bart-ek
      Icon for Helper I rankHelper I

      actually found a solution myself too after I've placed this thread 😄 ... 

       

      all('CALENDAR')
      instead of 
      all('test')
       
      that brings this result:
      • mwegener's avatar
        mwegener
        Icon for Most Valuable Professional rankMost Valuable Professional

        Hi Bart-ek ,

         

        Please mark a post as solution, this will help others.