cancel
Showing results for
Did you mean:
Highlighted
Member

## Is this possible?

Hi Guys,

Is this possible ......

With the date slicer, it shows my figures as it should when I have one date selected, when I select two dates, it adds the values together, is there a way that if you do select two dates, or 3 or 4 etc, it only shows me the values of most recent date.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: Is this possible?

Hi @KH11NDR

there is a way that if you do select two dates, or 3 or 4 etc, it only shows me the values of most recent date.

Create a measure to define today

`today = TODAY()`

Then create a calculated column to calculate how many days away from today

`days from today = ABS(DATEDIFF(Sheet1[date],[today],DAY))`

next create measures to find the  most recent date (away from today) based on the selected values with the slicer.

```most recent day = CALCULATE(MIN([days from today]),ALLSELECTED(Sheet1))
flag = IF([most recent day]=MAX([days from today]),1,0)
```

Finally, add "flag" measure to the Visual Level filter, then set "show value when item" is 1.

Best Regards

Maggie

3 REPLIES 3
Super User

## Re: Is this possible?

Possible, you would add a VAR __mostrecent = MAX('Table'[Date]) and then use that to decide whether to show something or not. Difficult to say though with the information provided. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Proud to be a Datanaut!

Established Member

## Re: Is this possible?

Sure, it's possible. You'll have to filter measure for [Date]=MAX([Date]).

Community Support Team

## Re: Is this possible?

Hi @KH11NDR

there is a way that if you do select two dates, or 3 or 4 etc, it only shows me the values of most recent date.

Create a measure to define today

`today = TODAY()`

Then create a calculated column to calculate how many days away from today

`days from today = ABS(DATEDIFF(Sheet1[date],[today],DAY))`

next create measures to find the  most recent date (away from today) based on the selected values with the slicer.

```most recent day = CALCULATE(MIN([days from today]),ALLSELECTED(Sheet1))
flag = IF([most recent day]=MAX([days from today]),1,0)
```

Finally, add "flag" measure to the Visual Level filter, then set "show value when item" is 1.

Best Regards

Maggie

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!

Top Ideas
Top Kudoed Authors
Users Online
Currently online: 264 members 3,038 guests
Recent signins: