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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Month over Month Change of a Calculated Measure Gives Wrong Result

Hello,

 

I have measure which is a custom running total of annualized sales (sales are related contracts). By saying custom running total, I mean that I`m excluding any sales amount from running total if a contract is expired for a spesific point of time. This measure is working well without an issue, but now I need calculate month over month % changes of this custom annualized sales running total.

 

I created a MoM% quick measure by using measure I mentioned above, however as you can see in the screenshot below, the MoM% is wrong, and I`m not sure why it`s happening.

 

In case the screenshot is to small to read, please my measure below:

 

Annualized Sales Cumulative (Excluding Expired Contracts) =
VAR mindate = MIN ( 'Journal Entries'[Accounting Date].[Date] )
VAR maxdate = MAX ( 'Journal Entries'[Accounting Date].[Date] )
RETURN
CALCULATE (
[Annualized Sales Amount],
ALLSELECTED ( 'Journal Entries' ),
'Contract Details'[Contract Effective Date] <= maxdate,
'Contract Details'[Contract Expiration Date] >= mindate
)
 
Annualized Sales Cumulative (Excluding Expired Contracts) MoM% =
IF(
    ISFILTERED('Journal Entries'[Accounting Date]),
    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(
            [Annualized Sales Cumulative (Excluding Expired Contracts)],
            DATEADD('Journal Entries'[Accounting Date].[Date], -1, MONTH)
        )
    RETURN
        DIVIDE(
            [Annualized Sales Cumulative (Excluding Expired Contracts)]
                - __PREV_MONTH,
            __PREV_MONTH
        )
)

 

I`d glad if someone can help me to resolve this.

Thank you,

 

Screenshot.PNG

   

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @Anonymous ,

You can try to write Annualized Sales Cumulative (Excluding Expired Contracts) in a calculated column, then the Annualized Sales Cumulative (Excluding Expired Contracts) MoM% can be this:

Annualized Sales Cumulative  MoM% =
VAR _DIFF =
    'Journal Entries'[Annualized Sales Cumulative (Excluding Expired Contracts)]
        - MAXX (
            FILTER (
                ALL ( 'Journal Entries' ),
                'Journal Entries'[Month]
                    = MAX ( 'Journal Entries'[Month] ) - 1
            ),
            'Journal Entries'[Column]
        )
RETURN
    DIVIDE ( _DIFF, MAX ( 'Journal Entries'[Column] ) )

You can modify the formula appropriately according to your model, it is easier to calculate the decrement by column.

vkalyjmsft_0-1640072995083.png

I attach my sample below for reference.

Best Regards,
Community Support Team _ kalyj

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Thank your response. I tried but the "Annualized Sales Cumulative (Excluding Expired Contracts)" column solution is not working due to the fact that the result of measure changes depending on time perspective (which point of time based on Accounting Date). So my understanding is this measure can't be static in a column. 

 

Please see a demonstration of the fact table below. If I look this measure:

as of 3/1/2021 Annualized Sales Cumulative (Excluding Expired Contracts) should be calculated as $100,

as of 9/1/2021 Annualized Sales Cumulative (Excluding Expired Contracts) should be calculated as $250,

as of 3/1/2022 Annualized Sales Cumulative (Excluding Expired Contracts) should be calculated as $150

 

 Contract Effective DateContract Expiration DateAnnualized Sales Amount
1-15-20211-1-20211-1-2022100
8-31-20216-1-20216-1-2022150

 

Hope it make sense. It`d be great to hear if there is another way to calculate "Annualized Sales Cumulative (Excluding Expired Contracts)" measure to be able to calculate MoM% properly. As I mentioned, I tried to create column but it gave significantly off results.

 

Than you,

 

amitchandak
Super User
Super User

@Anonymous , You should use date table and time intelligence

 

examples

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

 

 

Learn Power BI Advance Part 3- PowerBI Abstract Thesis: Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI : https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi, thank you for your response!

I tried Date table but i received the same results. Also, my original data model is pretty big with multiple dates in my fact table as well in dimension tables. So everytime i try dates table approach, it creates a huge headaches. So it`s not something I`d prefer but even thought I tried it didn't work.  

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.