Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
giridhara
Regular Visitor

Date Range slicer start date and end date to custom dates

 

I have a table of sales data, The sales data contain the store location, date, and sales total.

I use a slicer with a date column and slicer option style as between to get a start and end date option in visualization.

When I freshly open the report the filter start date and end date are set to values that are not available in my table, How to restrict them?

I am trying to figure out if I can set the start date to min(table[date]) and the end date to max(table[date]) to the filter, so the date picker filter will start with the dates I have in my table.

 

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with this Table formula

Calendar = calendar(min(table[date]),max(table[date]))

Create a relationship (Many to One and Single) from the Date column of Table to the Date column of the Calendar Table.  Create your slicer from the Date column of the Calendar Table.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

Priya1969
Resolver I
Resolver I

Store NameLocationDateSales
WalmartIL12/10/20221000
WalmartNY12/10/20221200
CostcoIL12/11/2022700
WalmartNY12/11/2022500
CostcoNY12/12/20222000

 

1.Create a two slicer one with store name and other one with date

2. Create a Matrix visual with store name, date, and sales value

3. Both the slicer format pane, select slicer setting, off the multi select, and on the "Select all" option

4. Choose slicer option dropdown instead of between. Now you can see the desired output. 

Priya1969_0-1672278686208.png

Priya1969_1-1672278768870.png

 

 

 

View solution in original post

7 REPLIES 7
Priya1969
Resolver I
Resolver I

Store NameLocationDateSales
WalmartIL12/10/20221000
WalmartNY12/10/20221200
CostcoIL12/11/2022700
WalmartNY12/11/2022500
CostcoNY12/12/20222000

 

1.Create a two slicer one with store name and other one with date

2. Create a Matrix visual with store name, date, and sales value

3. Both the slicer format pane, select slicer setting, off the multi select, and on the "Select all" option

4. Choose slicer option dropdown instead of between. Now you can see the desired output. 

Priya1969_0-1672278686208.png

Priya1969_1-1672278768870.png

 

 

 

The list is working well, but when I use the between in slicer settings and select one start date and one end date, and I change the store name, the dates are not defaulting to the first date of the dates table as start and the last date of the date table as end date.

 

E.g.: 

As per your data, I selected Costco as the option, and Even if Costco doesn't have data on the 10th, the date picker is still showing it. Can we make this date picker dynamic which can default to the start date as min date and the end date as the max date for the data reflecting after selecting the filters?

 

giridhara_0-1672351483599.png

 

The between option is not working out. I am trying in multiple ways... still struggling to figuring out.

Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with this Table formula

Calendar = calendar(min(table[date]),max(table[date]))

Create a relationship (Many to One and Single) from the Date column of Table to the Date column of the Calendar Table.  Create your slicer from the Date column of the Calendar Table.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Will these values update based on the other filters?

I have a list drop-down filter that gives stores.

In the filter, If I select the Store name as SR then the date filter should automatically show the start date of 12/10/2022 and the end date of 12/11/2022. 

 

If I select DR then the start date should be 12/10/2022 and the end date is 12/12/2022. Are the filters can update the values?

 

Store nameLocationDateSales
SRPX12/10/221000
DRPX12/10/221000
SRMO12/10/22500
SRMO12/11/22500
DRMO12/12/221000

Store NameLocationDateSales
WalmartIL12/10/20221000
WalmartNY12/10/20221200
CostcoIL12/11/2022700
WalmartNY12/11/2022500
CostcoNY12/12/20222000

 

1. Create a two slicer one with store name and other one with date

2. Create a Matrix visual with store name, date, and sales value

3. Both the slicer format pane, select slicer setting-selection, off the multi select, and on the "Show Select all" option

4. Choose slicer option dropdown instead of between. Now you can see the desired output. 

Priya1969_0-1672278686208.png

Priya1969_1-1672278768870.png

 

 

 

Hi,

Create a Date slicer from the Calendar table and select a range of dates there.  Create a slicer of Stores and select a certain store.  To your Matrix visual, drag Date from the Calendar table and write this measure

Measure = sum(Data[Sales])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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