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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
MicheleGenerali
Frequent Visitor

Calculate MoM with specific Date

Hi all, 
i have table query with 4 columns : DATE, SALES, SALES 22 and SALES 23. 
My date column has date from 01-jan-2022 to today, the SALES column have the value and the SALES 22 and 23 columns are conditional columns with values only for the specified year.  The problem is that my sales values are cumulative, so for february I have jan+feb, for march i have jan+ feb + march....
I'm tryng to find the MoM for each year so i can compare Month sales from Jan23 to sales of Jan22 and so on, and i want to have an Histogram like this : 

MicheleGenerali_0-1694608994178.png

I have 2 measures to calculate MoM for each year but having only one date column when i try to compare them, my jan 2023 sales values are negative.

SALES 23 MoM 2 =
    VAR __PREV_MONTH =
        CALCULATE(
            SUM('Table'[SALES 23]),
            DATEADD('Table'[DATE].[Date], -1, MONTH)
        )
    RETURN
        SUM('Table'[SALES 23]) - __PREV_MONTH

 

I also tried to work with 2 different table, one for 2022 and one for 2023, and link them to a calendar table, and in this case the measures work but i cant compare MoM in my histogram because of the dates, as i have an X-axis starting at jan-2022 and ending in dec-2023.
Can someone help me ? 
Thank u in advance

1 REPLY 1
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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