Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I want to calculate a running total of a column as a new column and created the following DAX-formula:
Who has an idea, what the problem is. Thanks,
Holger
Solved! Go to Solution.
@Mauerwinkel See PBIX attached below signature:
RT =
VAR __Index = [Index]
VAR __Table = FILTER('Table',[Index]<=__Index)
RETURN
SUMX(__Table,[Production (Wh)])
DateTime Production (Wh) Bezug (Wh) Einspeisung (Wh) Index
01.01.2022 00:00 | 0 | 167 | 0 | 1 |
01.01.2022 01:00 | 0 | 179 | 0 | 2 |
01.01.2022 02:00 | 0 | 155 | 0 | 3 |
01.01.2022 03:00 | 0 | 146 | 0 | 4 |
01.01.2022 04:00 | 0 | 173 | 0 | 5 |
01.01.2022 05:00 | 0 | 151 | 0 | 6 |
01.01.2022 06:00 | 0 | 189 | 0 | 7 |
01.01.2022 07:00 | 0 | 160 | 0 | 8 |
01.01.2022 08:00 | 0 | 154 | 0 | 9 |
01.01.2022 09:00 | 61 | 111 | 13 | 10 |
01.01.2022 10:00 | 223 | 1 | 82 | 11 |
01.01.2022 11:00 | 520 | 1 | 366 | 12 |
01.01.2022 12:00 | 992 | 0 | 809 | 13 |
01.01.2022 13:00 | 1205 | 0 | 1015 | 14 |
01.01.2022 14:00 | 688 | 0 | 545 | 15 |
01.01.2022 15:00 | 209 | 3 | 56 | 16 |
01.01.2022 16:00 | 15 | 146 | 0 | 17 |
01.01.2022 17:00 | 0 | 188 | 0 | 18 |
01.01.2022 18:00 | 0 | 210 | 0 | 19 |
@Mauerwinkel See PBIX attached below signature:
RT =
VAR __Index = [Index]
VAR __Table = FILTER('Table',[Index]<=__Index)
RETURN
SUMX(__Table,[Production (Wh)])
@Mauerwinkel Not surprising since you are using CALCULATE. There's a better way: Better Running Total - Microsoft Power BI Community
Thanks, now I get this:
@Mauerwinkel Please post a sample of your data as text so that I can mock up a PBIX file for you.
User | Count |
---|---|
106 | |
90 | |
82 | |
76 | |
73 |
User | Count |
---|---|
112 | |
101 | |
96 | |
74 | |
67 |