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.
My formula below works properly for customers that have Revenue > 0 in all 11 months between Jan 1 2018 and Nov 30 2018. I am dividing by 11 (highlighted in red below).
Solved! Go to Solution.
Hello @Anonymous
You can use some variables and filters in your measure to get the count of the number of months where the revenue <> 0 for each customer.
AvgRevenueJanNov = VAR Jan = DATE ( 2018, 1, 1 ) VAR Nov = DATE ( 2018, 11, 30 ) VAR RowCount = CALCULATE ( COUNTROWS ( VALUES ( CustomerMargin[Date] ) ), DATESBETWEEN ( CustomerMargin[Date], Jan, Nov ), CustomerMargin[Revenue] <> 0 ) RETURN DIVIDE ( CALCULATE ( SUM ( CustomerMargin[Revenue] ), DATESBETWEEN ( CustomerMargin[Date], Jan, Nov ) ), RowCount, 0 )
Hello @Anonymous
You can use some variables and filters in your measure to get the count of the number of months where the revenue <> 0 for each customer.
AvgRevenueJanNov = VAR Jan = DATE ( 2018, 1, 1 ) VAR Nov = DATE ( 2018, 11, 30 ) VAR RowCount = CALCULATE ( COUNTROWS ( VALUES ( CustomerMargin[Date] ) ), DATESBETWEEN ( CustomerMargin[Date], Jan, Nov ), CustomerMargin[Revenue] <> 0 ) RETURN DIVIDE ( CALCULATE ( SUM ( CustomerMargin[Revenue] ), DATESBETWEEN ( CustomerMargin[Date], Jan, Nov ) ), RowCount, 0 )
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.