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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.