cancel
Showing results for
Did you mean:
Member

## Filter data using date range from slicer

Hi ,

I am trying to filter submissions count by a range of dates enterd in slicer  (between)

For example if a user enter a range of date the table should show the count of submissions for that range of dates.

I created this formula, it works when I choose one date but not a range, any help

Current_Submission =

var  startdate= max(DimDate[Date])

var  enddate = min(DimDate[Date])                                                                                                                                              Return

calculate(DISTINCTCOUNT(

Submisions[Submission Number]),

Filter (Submisions,  Submisions[Submission Date]>= startdate      &&   Submisions[Submission Date] <= enddate                                                                )                                                                                                                                                                               )

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft

## Re: Filter data using date range from slicer

Hi @Manar,

Based on my test, you could refer to below steps:

Sample data:

Create a measure:

Current_Submission =
var startdate= max(DimDate[Date])
var enddate = min(DimDate[Date]) Return
calculate(DISTINCTCOUNT(Submission[Number]),
Filter (ALL(Submission), Submission[Date]<= startdate&&Submission[Date]>= enddate))

Now you could see the result:

https://www.dropbox.com/s/t5zoiqxm1d6aqcx/Filter%20data%20using%20date%20range%20from%20slicer.pbix?...

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Highlighted
Super Contributor

## Re: Filter data using date range from slicer

```Current_Submission =

VAR startdate= MIN(DimDate[Date])

VAR enddate  = MAX(DimDate[Date])                                                                                                                       Return

calculate(DISTINCTCOUNT(Submisions[Submission Number]),
Filter (Submisions,Submisions[Submission Date]>= startdate &&                                   Submisions[Submission Date]<= enddate  )            )```

Try this.

Thanks
Raj

Microsoft

## Re: Filter data using date range from slicer

Hi @Manar,

Based on my test, you could refer to below steps:

Sample data:

Create a measure:

Current_Submission =
var startdate= max(DimDate[Date])
var enddate = min(DimDate[Date]) Return
calculate(DISTINCTCOUNT(Submission[Number]),
Filter (ALL(Submission), Submission[Date]<= startdate&&Submission[Date]>= enddate))

Now you could see the result:

https://www.dropbox.com/s/t5zoiqxm1d6aqcx/Filter%20data%20using%20date%20range%20from%20slicer.pbix?...

Regards,

Daniel He

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

## Re: Filter data using date range from slicer

@v-danhe-msft  this worked,  thank you so much!

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.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!