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

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

Reply
Anonymous
Not applicable

Need help formatting data structure.

Hi so I have a data source that gives a sales persons numbers in this format:

DateSale amount
4/1/20$100
6/1/20$200
6/3/20$200

 

I need to be able to format the data so it becomes a cumulative total and includes all the months up to the current month.

DateSales Amount (Cumulative Total)
4/1/20$100
5/1/20$100
6/1/20$500
7/1/20$500
8/1/20$500

 

Any ideas on how to create a data table that has this structure?

 

Thanks as always!!

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

first create a calendar table

Calendar = CALENDARAUTO()

then you can create whether a calculated column

Sales Amount (Cumulative Total) =
CALCULATE(SUM(Table[Sale amount]), FILTER(ALL(Table]), Table[Date] <= EARLIER(Calendar[Date])))

or measure 

Sales Amount (Cumulative Total) =
CALCULATE(SUM(Table[Sale amount]), FILTER(ALL(Table]), Table[Date] <= MAX(Calendar[Date])))

 for this calendar table


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , you have to create measure like, with a date table

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=max(Sales[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 :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-YTD-LYTD-Week-Over-Week/m-p/1051626#M184


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
az38
Community Champion
Community Champion

Hi @Anonymous 

first create a calendar table

Calendar = CALENDARAUTO()

then you can create whether a calculated column

Sales Amount (Cumulative Total) =
CALCULATE(SUM(Table[Sale amount]), FILTER(ALL(Table]), Table[Date] <= EARLIER(Calendar[Date])))

or measure 

Sales Amount (Cumulative Total) =
CALCULATE(SUM(Table[Sale amount]), FILTER(ALL(Table]), Table[Date] <= MAX(Calendar[Date])))

 for this calendar table


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

This is very close with the measure but it is giving an unexpected result. It is assigning the total sum of that column to a every person. Not a cumulative total of each person for each month.

@az38 

Capture.PNG

az38
Community Champion
Community Champion

@Anonymous 

do you have relationships between calendar table and sales table?

what table (calendar or sales) do you use as date columns in visual?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

here is a tutorial on running totals

 

 

if you want to practice, you can download the materials here: https://businessintelligist.com/2020/07/22/getting-better-at-dax-having-fun-with-running-totals/

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.