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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 |
| 2 | 55 |
| 3 | 83 |
| 4 | 0 |
| 5 | 0 |
| 6 | 0 |
| 7 | 0 |
| 8 | 0 |
| 9 | 0 |
| 10 | 0 |
| 11 | 0 |
| 12 | 0 |
but I want this
| 1 | 40 |
| 2 | 55 |
| 3 | 83 |
| 4 | 83 |
| 5 | 83 |
| 6 | 83 |
| 7 | 83 |
| 8 | 83 |
| 9 | 83 |
| 10 | 83 |
| 11 | 83 |
| 12 | 83 |
For what it's worth, the sales are cumulative, so the max number will always be the month right before the current month.
Solved! Go to Solution.
@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])))
@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])))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 35 | |
| 31 | |
| 20 | |
| 13 | |
| 10 |