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

Year wise Month on Month comparison Dax

I have the data  from 2018 to 2025 . this data looks like  . i want comparision based on difference selection. if i select 1  Range 2019 January  and 2018 Januray value comparision . below formula used in Excel 

=(R5-F5)/F5

 

so created below formula for the measure 

 

n =
SELECTCOLUMNS(
    GENERATESERIES(1,12),
    "n", [Value]
)
 
Calculated column 
 
MonthSN = (Base[Year value].[Year]*12+[Month - Number])

 

 

MoM Difference =
VAR _currentmonthSN = MAX(Base[MonthSN])
VAR _n = SELECTEDVALUE(n[n])
VAR rate =
    DIVIDE(
        SUM(Base[Value]),
        CALCULATE(
            SUM(Base[Value]),
            ALL(Base),
            Base[MonthSN]=_currentmonthSN-_n
        )
    )^(1/_n)
    -1
RETURN
    IF(rate<>-1, rate, "")

 

 

Base Table :

 

Date                             Value                          Region

01-01-2018                  23                               EAST

01-01-2018                  43                               WEST

01-02-2018                  23                               EAST

01-02-2018                  43                               WEST

01-03-2018                  23                               EAST

01-03-2018                  43                               WEST

----

------

01-01-2019                 36                               EAST

01-01-2019                 62                               WEST

01-02-2019                 23                               EAST

01-02-2019                 53                               WEST

01-03-2019                 83                               EAST

01-03-2019                 93                               WEST

 

 

Looking for support .. thanks in advance ..

0 REPLIES 0

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.