cancel
Showing results for
Did you mean:
Highlighted
Anonymous
Not applicable

## Previous month dax

hello every body,

i work in a project and i can't use previous month measure.

I trie different solution :

prev month test = CALCULATE([sum relance2];PREVIOUSMONTH(Calendrier[Date]))

previous motnh 2 = CALCULATE(SUM('suivi écarts'[RELANCE_2]);
FILTER(Calendrier;MONTH(Calendrier[Date])=MONTH(TODAY())-1);
FILTER(Calendrier;YEAR(Calendrier[Date])= IF(MONTH(TODAY())=1;YEAR(TODAY())-1;YEAR(TODAY()))))

var current_month=MONTH(TODAY()) return CALCULATE(SUM('suivi écarts'[RELANCE_2]);FILTER(Calendrier;MONTH(Calendrier[Mois])=current_month -1))

i realise the measure for current month, but for previous month i can not.

Than and excuse me for my english guys

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support

## Re: Previous month dax

@Anonymous

You may take a look at the post below.

https://community.powerbi.com/t5/Desktop/Measure-to-calculate-previous-month-and-previous-second/td-...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Highlighted
Super User IV

## Re: Previous month dax

I prefer datesmtd and totalytd. Please find 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 MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date ],-1,MONTH))))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date ],-12,MONTH))))

MTD (Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR('Date'[Date ])))
MTD (Last Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR(dateadd('Date'[Date],-12,MONTH),"8/31")))``````

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.

Refer

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Proud to be a Super User!

Highlighted
Community Support

## Re: Previous month dax

@Anonymous

You may take a look at the post below.

https://community.powerbi.com/t5/Desktop/Measure-to-calculate-previous-month-and-previous-second/td-...

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Microsoft Power Platform Communities

Check out the Winners!

#### Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

#### Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors