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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Lanabanana
Regular Visitor

Calculating month-over-month while excluding blanks

Hi everyone,

I'm looking to exclude blank cells from a measure I've created.
I've got a formula where I'm calculating the month over month over a 15 year period for 27 products.
However, some of my products are introduced in the middle of the 15 year period. When I put them all in a visual, the products that start in the middle show -100% for all of the previous months.
The visual calculates the bottom N products and it always takes these products with the -100%
I've tried doing a simple filter that excludes the -100% but then when I filter for years that are prior to the middle of the period, the visual shows as empty.

Here are my measures:
PREV_MONTH = CALCULATE(SUM('Product '[VALUE]),DATEADD('Product'[Reference Period],-1,MONTH))

 Month over month = CALCULATE((DIVIDE(SUM('Product'[VALUE]),[PREV_MONTH])-1))


How do I insert a bit to exclude the calculating of blank values?

Thank you!
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Lanabanana 

Give this a try

Month over month =
VAR CurrMonth =
    SUM ( 'Product'[VALUE] )
RETURN
    IF ( NOT ISBLANK ( CurrMonth ), DIVIDE ( CurrMonth, [PREV_MONTH] ) - 1 )

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

Hello @Lanabanana 

Give this a try

Month over month =
VAR CurrMonth =
    SUM ( 'Product'[VALUE] )
RETURN
    IF ( NOT ISBLANK ( CurrMonth ), DIVIDE ( CurrMonth, [PREV_MONTH] ) - 1 )

Hey ,

This formula has worked for the most part.
But when I look at the first month that the product is introduced, it still shows -100% and I can't include my visual with the largest decreases for that month.
Is there a workaround to this?


EDIT: I replaced Currmonth with [PREV_MONTH] in the brackets after NOT ISBLANK and no more -100% for the first month. All fixed!

Thanks!

That did the trick! Amazing - thank you 🙂

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors