Reply
Manar
Helper II
Helper II

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
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Manar,

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

Sample data:

A.PNG

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:

C.PNG

You can also download the PBIX file to have a view.

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.

View solution in original post

3 REPLIES 3
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Manar,

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

Sample data:

A.PNG

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:

C.PNG

You can also download the PBIX file to have a view.

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.

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

avatar user
Anonymous
Not applicable

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

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)