cancel
Showing results for
Did you mean:
Super User

## How to calculate MOM% ?

Hi , below is my data sample. I want to use DAX formula to calculate the data in desired column(either column or measure). Then I can use the new column or measure to draw a line chart.

Proud to be a Super User!

2 ACCEPTED SOLUTIONS
Community Support

Hi @ryan_mayu,

Measure:

1. Create a dimtime table using the formula and create the relationship between the date table and the fact table.

`DIMTIME = CALENDARAUTO()`

2. Create the measure as below.

```Measure = VAR PRE = CALCULATE(SUM(Table1[Amount]),DATEADD(Table1[Date],-1,MONTH))
VAR CUR = CALCULATE(SUM(Table1[Amount]))
RETURN
IF(ISBLANK(PRE),0,(CUR-PRE)/PRE)```

Calculated column:

`Pre = CALCULATE(SUM(Table1[Amount]),DATEADD(Table1[Date],-1,MONTH))`
`result = IF(ISBLANK(Table1[Pre]),0,(Table1[Amount]-Table1[Pre])/Table1[Pre])`

For more details, please check the pbix as attached.Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Super User

Hi,

Regards,
Ashish Mathur
http://www.ashishmathur.com
4 REPLIES 4
Super User

Hi,

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Super User

Hi Ashish,

Thanks

Ryan

Proud to be a Super User!

Super User

Hi,

Regards,
Ashish Mathur
http://www.ashishmathur.com
Community Support

Hi @ryan_mayu,

Measure:

1. Create a dimtime table using the formula and create the relationship between the date table and the fact table.

`DIMTIME = CALENDARAUTO()`

2. Create the measure as below.

```Measure = VAR PRE = CALCULATE(SUM(Table1[Amount]),DATEADD(Table1[Date],-1,MONTH))
VAR CUR = CALCULATE(SUM(Table1[Amount]))
RETURN
IF(ISBLANK(PRE),0,(CUR-PRE)/PRE)```

Calculated column:

`Pre = CALCULATE(SUM(Table1[Amount]),DATEADD(Table1[Date],-1,MONTH))`
`result = IF(ISBLANK(Table1[Pre]),0,(Table1[Amount]-Table1[Pre])/Table1[Pre])`

For more details, please check the pbix as attached.Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Announcements

#### Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

#### The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

#### Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

#### Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

Top Solution Authors
Top Kudoed Authors