Forum Discussion

Devon-Yeager's avatar
Devon-Yeager
Frequent Visitor
1 year ago
Solved

Running total not giving correct answer

I'm trying to get the running sum of hours of a measure that ultimately includes a calculation of an average.  Power BI isn't giving me the correct answer.      Correct Hours Power BIs answer...
  • Irwan's avatar
    Irwan
    1 year ago

    hello Devon-Yeager 

     

    if i am not misunderstood the discussion, the problem is how to calculate running sum from a measure.

    next the [Available Hours] is a form of measure from another calculation.

     

    please check if this accomodate your expected result (please ignore the index as it works only as sorting in table visual).

     

    i think the [5. Running Sum] above should be matched to your correct hours.

     

    create a new measure for calculating Running Sum

    5. Running Sum = 
    SUMX(
        FILTER(
            ALL('Table'),
            'Table'[Date]<=MAX('Table'[Date])
        ),
        [Available Hours]
    )
     
    i made the [Available Hours] above as a measure because your original data has [Available Hours] as measure.
    i assumed you have expected result for calculations before [Available Hours].
     
    Hope this will help.
    Thank you.