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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Cumulative Value calculate with Dax Measure

Hello Experts!

I try to calculate the cumulative Headcounts, and the  Calculation is sucessed when i try to caluclate without Dax measure, as below:

Cumulative HC = CALCULATE(sum(Headcount[Headcount]),FILTER(all('Working days'),'Working days'[Month]<= MAX('Working days'[Month])))
RW0711_0-1667294038083.png

 

But When i try to use a DAX instead of Sum, it is not workintg :
the DAX is to calculate effective Headcount: 
Effective HC = DIVIDE( [Toal Working Hours], [Working hrs Value]*sum('Working days'[Working days]) )
The Cumulative Effective headcount as 
Cumulative effective HC = CALCULATE([Effective HC], FILTER(all('Working days'),'Working days'[Month]<= MAX('Working days'[Month])))
 
Then It returns table like average  headcount
RW0711_2-1667294207917.png

Is because the DAX measure? T.T

Please help out, thanks!

 

BR


 

2 ACCEPTED SOLUTIONS

Hi,

I am not quite sure whether I fully understood your second question, but are you trying to create a table? SUMX function does not show Table as a result, but a single value. SUMMARIZE function does show table as a result.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

Hi,

In case only [Effective HC] measure is used inside CALCULATE, I think it will not cumulatively sum, because the measure [Effective HC] itself is created by using divide function. If it needs to be seen as cumulative sum, then I think SUMX function has to be written together with proper virtual table.

 

I think the below measure may be is written in a more easy way to read.

 

 

Cumulative effective HC =
CALCULATE (
    SUMX (
        ADDCOLUMNS (
            SUMMARIZE ( 'TableName', 'TableName'[Cost Center], 'Working days'[Month] ),
            "@effectiveHC", [Effective HC]
        ),
        [@effectiveHC]
    ),
    FILTER (
        ALL ( 'Working days' ),
        'Working days'[Month] <= MAX ( 'Working days'[Month] )
    )
)

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

6 REPLIES 6
Jihwan_Kim
Super User
Super User

Hi,

Please try something like below.

 

 

Cumulative effective HC =
CALCULATE (
    SUMX (
        SUMMARIZE ( 'TableName', 'TableName'[Cost Center], 'Working days'[Month] ),
        [Effective HC]
    ),
    FILTER (
        ALL ( 'Working days' ),
        'Working days'[Month] <= MAX ( 'Working days'[Month] )
    )
)

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Hello! 

thanks a lot, it really works. 

But i try to understood the logic, so i breakdown the formula

In below formula, it is not working

RW0711_0-1667308911688.png

So i edit it like this below, then the table column "Effective" returns correct value. 

RW0711_1-1667308988900.png

 

Could you tell why is like this? thanks in advance!

 

Anonymous
Not applicable

Hello!

Yes, you are right, i shouldnt use SUMX as a table..

but to understand the formula you wrote: 

SUMX ( SUMMARIZE ( 'TableName', 'TableName'[Cost Center], 'Working days'[Month] ), [Effective HC] )

does it means  the Expression "[Effective HC] start to work, when meet the filter context (cost center, month) created from Summarize function? 

 

 

Hi,

In case only [Effective HC] measure is used inside CALCULATE, I think it will not cumulatively sum, because the measure [Effective HC] itself is created by using divide function. If it needs to be seen as cumulative sum, then I think SUMX function has to be written together with proper virtual table.

 

I think the below measure may be is written in a more easy way to read.

 

 

Cumulative effective HC =
CALCULATE (
    SUMX (
        ADDCOLUMNS (
            SUMMARIZE ( 'TableName', 'TableName'[Cost Center], 'Working days'[Month] ),
            "@effectiveHC", [Effective HC]
        ),
        [@effectiveHC]
    ),
    FILTER (
        ALL ( 'Working days' ),
        'Working days'[Month] <= MAX ( 'Working days'[Month] )
    )
)

 

 

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

Now i understood, thanks alot 🙂

Hi,

I am not quite sure whether I fully understood your second question, but are you trying to create a table? SUMX function does not show Table as a result, but a single value. SUMMARIZE function does show table as a result.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors