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
Build_PBI
Frequent Visitor

How to calculate cumulative values by daily

Hi there, 

I would like to set DAX to calculate daily cumulative session value.
Please let me know how I can do it.  I wrote the situation and what i want to do as below.

<Situation> 
I have a data table which has session of web site by daily bases(Table 1 below).  I would like to add one column to calculate session to pile it up.  And want to reset the cumulative session values at 1st day of month(Table 2 below)

- Table 1 -
Date|Year |Month |Day|Area|Session|
2018/1/1|2018|1|1|US|10000
2018/1/2|2018|1|2|US|10000
2018/1/3|2018|1|3|US|10000

-Table2-
Date|Year|Month|Day|Area|Session|Cumulative Session
2018/1/1|2018|1|1|US|10000|10000
2018/1/2|2018|1|2|US|10000|20000
2018/1/3|2018|1|3|US|10000|30000
...
2018/1/31|2018|1|31|US|10000|310000
2018/2/1|2018|2|1|US|10000|10000
2018/2/2|2018|2|2|US|10000|20000

 

Please give your advice!!

1 ACCEPTED SOLUTION

I got a solution for this.

 

Create measure as MTD session(MTD TTL Session) first, then, Create new measure as  below. 

 

Monthly Cumulative Session =
CALCULATE([MTD TTL Session],
FILTER(ALLSELECTED([Date]),[Date] <= MAX([Date])))

 

 

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Have you tried the running total Quick Measure? Or, you could try my Time Intelligence The Hard Way in the Quick Measure Gallery (it's really not that hard).

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

Thanks for your advice but running total quick measure does not wark well.

because we want to rest to cumulative calcuration every 1st date of month.   it seems that quick measure can not do this.

 

And I want to fitler Area.  Area clumn has like US, UK and DE.

So, I want to do this ...("[]" is condition)

[Sum] daily sessions 

[Between] First date of the month to Date on the row

[Group By] Area, Year, Month

 

do you have any great solution?

 

Thanks 

I got a solution for this.

 

Create measure as MTD session(MTD TTL Session) first, then, Create new measure as  below. 

 

Monthly Cumulative Session =
CALCULATE([MTD TTL Session],
FILTER(ALLSELECTED([Date]),[Date] <= MAX([Date])))

 

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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