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! Learn more

Reply
tomekm
Helper III
Helper III

Dinamic Month over Month change calculation

Hi,

 

I'm trying to create a column that will show the "Change" in Volume for each ID. Please see table below. If I filter on a specific month, I'd like to see the total of Changes for each ID number. Can you please help me with the DAX formula?

 

Thank you.

 

 

IDVolumePeriods_TableChange (expected outcome)
101February 1, 20210
105March 1, 20214
103April 1, 2021-2
202March 1, 20210
203April 1, 20213
3012February 1, 20210
3013March 1, 20211
304April 1, 2021-9
402March 1, 20210
402April 1, 20210
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @tomekm ;

Please try:

new column = 
VAR _last =
    EOMONTH ( [Periods_Table], -1 )
RETURN
    IF (
        [Periods_Table]= CALCULATE ( MIN ( [Periods_Table] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
        0,
        [Volume]- CALCULATE (SUM ( [Volume] ), FILTER (
                    ALLEXCEPT ( 'Table', 'Table'[ID] ),
                    EOMONTH ( [Periods_Table], 0 ) = _last)))

The final output is shown below:

vyalanwumsft_0-1628486914959.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @tomekm ;

Please try:

new column = 
VAR _last =
    EOMONTH ( [Periods_Table], -1 )
RETURN
    IF (
        [Periods_Table]= CALCULATE ( MIN ( [Periods_Table] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
        0,
        [Volume]- CALCULATE (SUM ( [Volume] ), FILTER (
                    ALLEXCEPT ( 'Table', 'Table'[ID] ),
                    EOMONTH ( [Periods_Table], 0 ) = _last)))

The final output is shown below:

vyalanwumsft_0-1628486914959.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you!

tomekm
Helper III
Helper III

 

The formula works but partially. Please see screenshot. Ideally I would want to show "+8" in the July row, instead of "-8" in June, as we are measuring the changes from previous month to current month (i.e. July).

 

Capture.JPG

amitchandak
Super User
Super User

@tomekm , Try a new column like

new colum =
var _period = eomonth([Periods_Table],-1)
var _id = [ID]
return
[Volume] - (sumx(filter(table, eomonth([Periods_Table],0) = _period && [ID] = _id),[Volume])+0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello,

 

Would you be able to help me with my previous post? "The formula works but partially. Please see screenshot. Ideally I would want to show "+8" in the July row, instead of "-8" in June, as we are measuring the changes from previous month to current month (i.e. July)."

 

Thank you.

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