Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
hi,
I'm trying to incremental summing my table's column value by it's datetime and group.
so far, I have created this dax code for it:
CALCULATE(SUM('my_table'[value]),FILTER('my_table'[type]='my_table'[type]&&'my_table'[datetime]<=EARLIER('my_table'[datetime])))
this code are doing the incrimental summing, but it won't sum my value data for each group that i have.
do anyone have idea where did my code went wrong?
or maybe another way to get the result that I want.
Solved! Go to Solution.
hi,
fixed my code and got the result that I want.
this is my final code, in case there are someon who has the same problem
column = CALCULATE(SUM('my_table'[value]),FILTER('my_table','my_table'[datetime]<=EARLIER('my_table'[datetime])&&'my_table'[type]=EARLIER(my_table[type])))
hi,
fixed my code and got the result that I want.
this is my final code, in case there are someon who has the same problem
column = CALCULATE(SUM('my_table'[value]),FILTER('my_table','my_table'[datetime]<=EARLIER('my_table'[datetime])&&'my_table'[type]=EARLIER(my_table[type])))
Hello @Anonymous
Give this a try:
Running Total = VAR MaxDate = MAX ( MyTable[DateTime] ) RETURN CALCULATE ( SUM ( MyTable[Value] ), ALL ( MyTable[DateTime] ), MyTable[DateTime] <= MaxDate )
hi @jdbuchanan71 ,
thank you for the code.
tried it on my side, but sadly it's not incrementally sum my value but only showing the exact same data as my value collumn
type | value | datetime | expected_result | result_from_my_code | result_from_your_code |
CR | 5 | 2019/04/01 0:00 | 5 | 15 | 5 |
CR | 5 | 2019/05/01 0:00 | 10 | 30 | 5 |
CR | 5 | 2019/06/01 0:00 | 15 | 45 | 5 |
KR | 6 | 2019/04/01 0:00 | 6 | 15 | 6 |
KR | 6 | 2019/05/01 0:00 | 12 | 30 | 6 |
KR | 6 | 2019/06/01 0:00 | 18 | 45 | 6 |
YR | 4 | 2019/04/01 0:00 | 4 | 15 | 4 |
YR | 4 | 2019/05/01 0:00 | 8 | 30 | 4 |
YR | 4 | 2019/06/01 0:00 | 12 | 45 | 4 |
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
102 | |
85 | |
77 | |
69 |
User | Count |
---|---|
120 | |
110 | |
95 | |
82 | |
77 |