cancel
Showing results for
Did you mean:
New Member

## Calculating difference between totals from dates not in sequence

Hello,

I am trying to show the difference between two totals on two different days. However, my dates are not in sequence (sometimes 7 days apart, sometimes 6 days apart, etc.). I have created an index number thing ing I could create a measure to just sum my current measure for "Index Number" -1, but that does not seem to work.

Ultimately, I want to be able to show the totals for both dates and the difference between them so I can plot the grow / decline in totals.

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Calculating difference between totals from dates not in sequence

You may refer to the measure below.

```Measure 2 =
VAR i =
MAX ( Table1[Index] )
RETURN
CALCULATE (
[Measure],
FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = i - 1 )
)
```
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.
3 REPLIES 3
Super User

## Re: Calculating difference between totals from dates not in sequence

That being said, I think maybe EARLIER? See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...

Check-out my Back to School contest submission: Dinosaurs!

Proud to be a Datanaut!

Community Support Team

## Re: Calculating difference between totals from dates not in sequence

You may refer to the measure below.

```Measure 2 =
VAR i =
MAX ( Table1[Index] )
RETURN
CALCULATE (
[Measure],
FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = i - 1 )
)
```
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.
Super User

## Re: Calculating difference between totals from dates not in sequence

Hi,

Announcements

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 104 members 1,545 guests
Recent signins: