Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
zzzsou
Frequent Visitor

How to show all cumulative sums

Hello, 

 

the raw data format is like this table below.

TypeWeeknumHit count
A11
A21
A31
A81
A91
A121
B10
B31
.........

 

for this kind of table, I would like to get cumlative sum of 13 weeks

so I made a dax formula using sum() and filter()

 

However the result is below

<cumlative sum of 13 weeks>

Weeknum12345678...
A1233   4 
B0 1      

 

I guess it's becuase for A dose not have weeknum 5,6,7

it does not return anything.

 

What I would like to get is... below

Weeknum12345678...
A12333334 
B011      

 

Could you help me please?

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @zzzsou 

 

You can try the following methodsCreate a new Weeknum table as a column of the matrix.

vzhangti_0-1678413251930.png

Measure = CALCULATE(SUM('Table'[Hit count]),FILTER(ALL('Weeknum'),[Weeknum]<=SELECTEDVALUE('Weeknum'[Weeknum])))

vzhangti_1-1678413331163.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
zzzsou
Frequent Visitor

Thank your for your reply! I applied it to my model and it works very well!!😃

v-zhangti
Community Support
Community Support

Hi, @zzzsou 

 

You can try the following methodsCreate a new Weeknum table as a column of the matrix.

vzhangti_0-1678413251930.png

Measure = CALCULATE(SUM('Table'[Hit count]),FILTER(ALL('Weeknum'),[Weeknum]<=SELECTEDVALUE('Weeknum'[Weeknum])))

vzhangti_1-1678413331163.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.