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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Brotedo
Helper I
Helper I

Fill empty column rows with max of other rows

I have a dataset with monthly sales numbers that correspond to a month index 1-12. I want the sales number for the current and future month to always display as the max of the previous months.

For example, if the current month was 4, what I have now is this:

1

40
255
383
4

0

50
60
70
80
90
100
110
120

but I want this

140
255
383
483
583
683
783
883
983
1083
1183
1283

For what it's worth, the sales are cumulative, so the max number will always be the month right before the current month.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Brotedo , With help from separate date/month table joined to your table used in visual and formula

 

a measure like

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

or

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

 

or

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('month'),'month'[month] <=max('month'[month])))

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Brotedo , With help from separate date/month table joined to your table used in visual and formula

 

a measure like

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

or

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected('Date'),'Date'[date] <=max('Date'[date])))

 

or

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('month'),'month'[month] <=max('month'[month])))

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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