Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Measure Filter not working as expected, How to involve current Value?

Hi there,

 as a newbie my situation looks quiet simple, but I am fully stuck. Tthere is a table with a userdefined column containing a duration:

IntervalPlus = [MyTime]+ #duration(0,0,60,0)

With this column I want to create a kind of predictive graph with a measure:

Measure = 
CALCULATE (
  SUM(ExData[MyValue]),
      FILTER('ExData', ExData[MyTime] <= ExData[IntervalPlus]),
      FILTER('ExData', ExData[MyTime] >= ExData[MyTime])
)
But it looks like the SUM(ExData[MyValue]) is taken overall data, not filtered.
What am I missing?
Thanks in advance
Frank
 
  • or directly like:

    Column =
    VAR _time = ExData[Time]
    RETURN
    SUMX(
        FILTER(
           ExData,
           ExData[Time]>=_time
       &&ExData[Time]<=_time+1/24/6
         ),
        ExData[Value]
    )

5 Replies

  • hi Anonymous 

    could you tell us more about your expectation the measure, like what do you mean by "predictive graph"?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Yes of yourse.
    I have a table with two columns: Time and a value witch contains an amount of events per 5 minute interval.
    For each 5 Minute Interval I want to create a new Datapoint containing the next 12 Rows in Sum, to get a real one hour SUM.
    Example in Excel Screenshots for 3 instead of 12 Rows:

    My try was to create a new column IntervalPlus with Time plus one hour (in this example 10 Minutes) and wanted to filter values where time is lower then IntervalPlus



    • FreemanZ's avatar
      FreemanZ
      Icon for Super User rankSuper User

      hi Anonymous 

      try like:

      Column =
      SUMX(
          FILTER(
             ExData,
             ExData[Time]>=EARLIER(ExData[Time])
         &&ExData[Time]<=[IntervalPlus]
           ),
          ExData[Value]
      )
      • FreemanZ's avatar
        FreemanZ
        Icon for Super User rankSuper User

        or directly like:

        Column =
        VAR _time = ExData[Time]
        RETURN
        SUMX(
            FILTER(
               ExData,
               ExData[Time]>=_time
           &&ExData[Time]<=_time+1/24/6
             ),
            ExData[Value]
        )