cancel
Showing results for
Did you mean:
Regular Visitor

## Last Month's Data

Hi,

I've found that I can use the following to identify a rolling prior 1 month period:

Present Month Volume = CALCULATE(SUM('Totals'[USD Total Amount]),
Date(YEAR(EDATE(today(),-1)),MONTH(EDATE(today(),-1)),1),
EOMONTH(today(),-1)))

The issue is that my data runs not from today as indicated in the formula, but from a random final date, usually the last day of the prior month.  How should I adapt the formula to deliver the prior month's result?

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

## Re: Last Month's Data

my data runs not from today as indicated in the formula, but from a random final date, usually the last day of the prior month.

What exact result are you expecting? Is the “prior month’s result” refers to the results from “today” subtracting one month? (So the final day is “today”).

As I tested, I have got a trade date column like:

Referring to your DAX, the final result becomes (the final day is 2017-12-31)

So I assume it is not the result set you want. (screenshot above)

Hence, as a quick guess, I suggest you replace the

Date(YEAR(EDATE(today(),-1)),MONTH(EDATE(today(),-1)),1),
EOMONTH(today(),-1)))

With

Then I get result ended up “today()”

Regards,

Charlie Liao

2 REPLIES 2
Moderator

## Re: Last Month's Data

my data runs not from today as indicated in the formula, but from a random final date, usually the last day of the prior month.

What exact result are you expecting? Is the “prior month’s result” refers to the results from “today” subtracting one month? (So the final day is “today”).

As I tested, I have got a trade date column like:

Referring to your DAX, the final result becomes (the final day is 2017-12-31)

So I assume it is not the result set you want. (screenshot above)

Hence, as a quick guess, I suggest you replace the

Date(YEAR(EDATE(today(),-1)),MONTH(EDATE(today(),-1)),1),
EOMONTH(today(),-1)))

With

Then I get result ended up “today()”

Regards,

Charlie Liao

Highlighted
Regular Visitor

## Re: Last Month's Data

Many thanks Charlie, that works.

Announcements

#### Back to School Contest

Engage and empower students with Power BI!

#### Watch Sessions On Demand!

Continue your learning in our online communities.

#### Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

#### PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 37 members 975 guests
Recent signins: