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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to create cumulative Total in Power BI bar chart. I need to show January value as 1000$ as fixed

Need to create cumulative Total in PowerBI bar chart. I need to show January sales 1000$  as fixed and Feb, march cumulative  value should be calculated based on data.I have already tried below dax but no luck so far:


Comulative Total =
VAR Baseline = CALCULATE(
COUNT('Sales'[sales_amount]),
FILTER(
ALLSELECTED('Sales'[Year_Month]),
'Sales'[Year_Month]="Oct-2020"))
VAR NUM = CALCULATE (
SUM ( 'Sales'[sales_amount] ),
FILTER (
ALLSELECTED( 'Sales' ),
'Sales'[YM] <= MAX ( 'Sales'[YM] )
)
)
RETURN Baseline+NUM

Here is expected output

MonthActual Sales(Sale_amount)Expected Comulative Total% Change from January
Jan11510000
Feb10011000.1
Mar5011500.15
April10012500.25
May20014500.45
June10015500.55

 

Comulative total of employee 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , If you have date you can Cumm Sales

 

Cumm Sales = CALCULATE(SUM(Table[Sale_amount]),filter(allselected(Table),Table[Date] <=max(Table[Date])))

 

For Change %
MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))


diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])

 

Prefer to use Date Table

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),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.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , If you have date you can Cumm Sales

 

Cumm Sales = CALCULATE(SUM(Table[Sale_amount]),filter(allselected(Table),Table[Date] <=max(Table[Date])))

 

For Change %
MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sale_amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))


diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])

 

Prefer to use Date Table

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),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.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.