Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
i have a table with two columns "Month", and Count. i want to create a third column that has the value for the cumulative sum of Count value plus the of the previous months.
The syntax below is not correct which is what i'm struggling with the most, but i'm hoping it helps explain what intend to do. there could be smarter ways to do this which is what i'm hoping for
Trends :=
VAR cumsum= 0
RETURN SWITCH(table,
"January", VAR jansum = countValue + cumsum
cumsum= jansum
RETURN cumsum,
"February", VAR febsum = countValue + cumsum
cumsum=febsum
RETURN cumsum)
any ideas would be grand. Thanks
Hi @Anonymous,
Did you solve it? Can you share the answer or mark the proper answer as a solution please?
Best Regards,
Dale
Hi @Anonymous,
What does your data look like? Maybe you can try the formula below.
Column =
CALCULATE (
SUM ( 'Table2'[count] ),
FILTER (
'Table2',
'Table2'[StartOfMonth] <= EARLIER ( 'Table2'[StartOfMonth] )
)
)
Best Regards,
Dale
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 48 | |
| 42 |