cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
financeBI1 Frequent Visitor
Frequent Visitor

Month Over Month Change (Exclude First Month and Month After)

Hi Power BI Community,

 

I am running into an issue using month over month change (not % change but actual difference). My data consists of month balances until the current month where it is the previous days balance. For Example, I have December 2017 to August 2019 (mid month), when I use the canned calculation for MoM, it shows December of 2017 as a full increase instead of dropping this month, and adds September 2019 showing a full decrease because there is no data. All months inbetween function correctly except the bookend months. Below is the canned formula, thanks for your help!

 

 

IF(
    ISFILTERED('query1'[Month End]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    VAR __PREV_MONTH = CALCULATE([weighted measure], DATEADD('query1'[Month End].[Date], -1, MONTH))
    RETURN
        DIVIDE([weighted measure] - __PREV_MONTH, __PREV_MONTH)
1 ACCEPTED SOLUTION

Accepted Solutions
v-lid-msft Super Contributor
Super Contributor

Re: Month Over Month Change (Exclude First Month and Month After)

Hi @financeBI1,

 

You can use the following Measure to count actual difference Month Over Month, but do not remember to close the “show items with no data”.

 

Measure = 
VAR pre =
    CALCULATE (
        [weighted measure],
        DATEADD ( 'query2'[Month End].[Date], -1, MONTH )
    )
VAR thisMonth =
    CALCULATE ( [Weighted Measure] )
VAR d =
    SELECTEDVALUE ( query2[Month End] )
VAR ma =
    MAXX ( ALL ( query2 ), [Month End] )
VAR mi =
    MINX ( ALL ( query2 ), query2[Month End] )
RETURN
    IF ( d > mi && d < ma, thisMonth - pre, BLANK () )

 

Month-Over-Month-Change-Exclude-First-Month-and-Month-After-1.pngMonth-Over-Month-Change-Exclude-First-Month-and-Month-After-2.pngMonth-Over-Month-Change-Exclude-First-Month-and-Month-After-3.png

 

BTW, pbix as attached.

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

View solution in original post

2 REPLIES 2
v-lid-msft Super Contributor
Super Contributor

Re: Month Over Month Change (Exclude First Month and Month After)

Hi @financeBI1,

 

You can use the following Measure to count actual difference Month Over Month, but do not remember to close the “show items with no data”.

 

Measure = 
VAR pre =
    CALCULATE (
        [weighted measure],
        DATEADD ( 'query2'[Month End].[Date], -1, MONTH )
    )
VAR thisMonth =
    CALCULATE ( [Weighted Measure] )
VAR d =
    SELECTEDVALUE ( query2[Month End] )
VAR ma =
    MAXX ( ALL ( query2 ), [Month End] )
VAR mi =
    MINX ( ALL ( query2 ), query2[Month End] )
RETURN
    IF ( d > mi && d < ma, thisMonth - pre, BLANK () )

 

Month-Over-Month-Change-Exclude-First-Month-and-Month-After-1.pngMonth-Over-Month-Change-Exclude-First-Month-and-Month-After-2.pngMonth-Over-Month-Change-Exclude-First-Month-and-Month-After-3.png

 

BTW, pbix as attached.

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

View solution in original post

financeBI1 Frequent Visitor
Frequent Visitor

Re: Month Over Month Change (Exclude First Month and Month After)

Thanks @v-lid-msft  for all your help, this worked!

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 147 members 1,557 guests
Please welcome our newest community members: