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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi all,
I have a question for you. I hope, I'll be answered from you quickly.
As you see attached, I have been calculated previous three rows sum, but I have a condition unfourtunately. My condition is row has until blank previous three rows get sum.
My formula is below,
How do I calculate ignore blanks?
I need show below,
Many thanks.
Regards.
Solved! Go to Solution.
Hi, @bbburcu ;
First you could create a month number column which have a sort column.
Month number = MONTH( CONVERT("2022-" &[Month]&"-1",DATETIME))
The create a column by dax.
Column =
IF([Month number]<4,BLANK(),
SUMX(
SUMMARIZE(
TOPN(3,
FILTER('Table',([Column 2]<>BLANK()||[Column 2]<>0) && [Month number]<EARLIER('Table'[Month number])),
'Table'[Month number],DESC),
[Column 2])
,[Column 2]))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @bbburcu ;
First you could create a month number column which have a sort column.
Month number = MONTH( CONVERT("2022-" &[Month]&"-1",DATETIME))
The create a column by dax.
Column =
IF([Month number]<4,BLANK(),
SUMX(
SUMMARIZE(
TOPN(3,
FILTER('Table',([Column 2]<>BLANK()||[Column 2]<>0) && [Month number]<EARLIER('Table'[Month number])),
'Table'[Month number],DESC),
[Column 2])
,[Column 2]))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@bbburcu , Assuming you are need a new column, rolling 3 months
New column =
var _date1 = eomonth([Date],-3)
var _date2 = eomonth([Date],-1) +1
return
Sumx(filter(Table, [Date] >= _date1 && [Date] <= _date2), [Column2])
if you need a measure
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Table[date_closed]),-3,MONTH))
Rolling Months Formula: https://youtu.be/GS5O4G81fww
Hi @amitchandak ,
It doesn't work. I have been calculated rolling 3 months ( as you see Column 4) but I have a condition.
If row is blank, it is not including blank row but total (any three previous row).
As you can see below how can I calculate?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.