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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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