Forum Discussion
Devon-Yeager
1 year agoFrequent Visitor
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...
- 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.
Devon-Yeager
1 year agoFrequent Visitor
Here are a couple more columns of data to help tell the story
| Correct Hours | Power BIs answer | ||||
| What If Employee Count | 3. Total Available Hours | 4. Available Hours | 5. Running Sum | ||
| 2024/Dec | 9.18 | 1006.86 | 730.86 | 730.86 | 730.86 |
| 2025/Jan | 9.18 | 1048.72 | 766.72 | 1497.58 | 1497.59 |
| 2025/Feb | 9.18 | 998.6 | 689.6 | 2187.18 | 2186.64 |
| 2025/Mar | 9.18 | 1036.61 | 731.61 | 2918.79 | 2918.79 |
| 2025/Apr | 10.18 | 1217.94 | 938.94 | 3857.73 | 3850.01 |
| 2025/May | 9.18 | 1042.66 | 773.66 | 4631.39 | 4623.77 |
| 2025/Jun | 9.18 | 945.72 | 710.72 | 5342.11 | 5333.61 |
| 2025/Jul | 10.18 | 1139.75 | 671.75 | 6013.86 | 6000.06 |
| 2025/Aug | 10.18 | 1030.42 | 562.42 | 6576.28 | 6562.02 |
| 2025/Sep | 10.18 | 1132.42 | 685.42 | 7261.7 | 7247.52 |
| 2025/Oct | 10.18 | 1260.69 | 845.69 | 8107.39 | 8086.51 |
| 2025/Nov | 10.18 | 954.07 | 539.07 | 8646.46 | 8638.06 |
| 2025/Dec | 10.18 | 1193.5 | 778.5 | 9424.96 | 9413.33 |
| 2026/Jan | 10.18 | 1113.49 | 532.49 | 9957.45 | 9948.18 |
| 2026/Feb | 10.18 | 1112.27 | 531.27 | 10488.72 | 10483.54 |
| 2026/Mar | 10.18 | 1224.04 | 643.04 | 11131.76 | 11123.57 |
| 2026/Apr | 10.18 | 1217.94 | 0 | 11131.76 | 10799.53 |
| 2026/May | 10.18 | 1107.38 | 0 | 11131.76 | 10313.08 |