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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
thanhnt2
New Member

Help

Hi all, i want to caculate cumulative average of column "Tổng nhân sự". I used dax: 

CALCULATE(SUM('NSLĐ'[Tổng nhân sự]),DATESYTD('NSLĐ'[Date]))
But results returned is current value of column "Tổng nhân sự". I dont know what's wrong? plz help me
Untitled.png
1 ACCEPTED SOLUTION
ALLUREAN
Solution Sage
Solution Sage

Hi, @thanhnt2

 

I tried using measures to achieve what you want.

https://www.dropbox.com/s/ab6vpfzxjk2819l/Average_YTD%28allure-analytics.com%29.pbix?dl=0

 

 




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ALLUREAN
Solution Sage
Solution Sage

Hi, @thanhnt2

 

I tried using measures to achieve what you want.

https://www.dropbox.com/s/ab6vpfzxjk2819l/Average_YTD%28allure-analytics.com%29.pbix?dl=0

 

 




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




ALLUREAN
Solution Sage
Solution Sage

Hi, @thanhnt2 

 

CALCULATE(AVERAGE('NSLĐ'[Tổng nhân sự]),

                ALL('NSLĐ'),'NSLĐ'[Date]<=EARLIER('NSLĐ'[Date]))

 

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Hi Allurenan

I try use your dax, but value need to break when pass the year. 

your dax, sum all value in  column.

amitchandak
Super User
Super User

@thanhnt2 , Based on level you want to do avg of sum, you need try a measure like this . Use date tbale with TI

 

example

 


CALCULATE(averageX(Values('Date'[Date]), calculate( SUM('NSLĐ'[Tổng nhân sự]))),DATESYTD('Date'[Date]))

 

Or Cumm

CALCULATE(averageX(Values('Date'[Date]), calculate( SUM('NSLĐ'[Tổng nhân sự]))) ,filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

 

or

 

CALCULATE(average('NSLĐ'[Tổng nhân sự]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors