cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## accessing last month of timeline

Hey!

I am having data with dates in it. For selecting a Time period, I use a timeline.

So for my report I need to find the relation between the value of the last month and the month bevore the last month of the selected time period within my timeline.

Is this somehow possible?

How can I access the filter criteria of the timeline?

BR,

6 REPLIES 6
Super User III

## Re: accessing last month of timeline

Hi @Anonymous

You're going to have to explain this a bit better.

What do you mean by "relation" and if the period is for instance a month, what value would you want to select in that period? the last day? the average of all days...?

Established Member

## Re: accessing last month of timeline

Can you share a example with some random data?

Anonymous
Not applicable

## Re: accessing last month of timeline

I have data like this:

01.01.2018, Val: 5

01.02.2018: Val: 6

...

01.11.2018: Val: 3

01.12.2018: Val: 9

...

If in the timeline May to October is slected, I want to get the Value of October and September.

If in the timeline January to October is selected, I want to get the Value of October and September.

If in thte timeline January to December is selected, I want to get the Value of December and November.

So for each month, I only have one value.

Established Member

## Re: accessing last month of timeline

If I understand this correctly, what you are trying to say is:

1. Get the last month of the selected timelines
2. Get the data of that month
3. Sum the value in step 2 with the data from the previous month we got from step 1

Right?

Anonymous
Not applicable

## Re: accessing last month of timeline

you are right! But not to sum it up. I want to do some calculations with it then within a measure! 😉

Established Member

## Re: accessing last month of timeline

Try creating the below measure to get the data for last month selected in the timeline:

`Measure = CALCULATE(SUM('Table1'[Value]),FILTER(ALL('Table1'), YEAR('Table1'[Date]) = YEAR(MAX('Table1'[Date])) && MONTH('Table1'[Date])= MONTH(MAX('Table1'[Date]))))`

Announcements

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

#### Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors