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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
willpage
Helper II
Helper II

Slider Control in a Slicer for Text Columns?

I have a data source that contains sales data per month. The table has a column called Year, which is a numeric year, and it also has both Month of Sale in Text, the full word for the month, e.g January, and also the numeric month number as an integer.

 

I need to create a report that allows the operator to see the sum of sales data across an arbitrary, user selectable range of dates, e.g. February 2017 to July 2018.

 

To this end, I created a column called Sortable Date in Power Query using the following formula, and changed its type to whole number:

 

Text.From([Year]) & Text.PadStart(Text.From([Month Number]),2,"0")

 

When I add this column to a slicer I get the slider control I need, all good. Except that it's not that human friendly:

image.png

 

So, next thing I did was create a new column called Friendly Date with this formula:

 

[Month of Sale] & " " & Text.From([Year])

 

Back in the report, I sorted this column by Sortable Date, but I just get a massive list of check boxes when used in a slicer:

image.png

 

Is there a way I can make it so I get the slider control as per sortable date, but with the friendly labels as per the Friendly date?

 

I need to only allow a range of dates, or a single month to be selected. It won't do for a user to be able to select a bunch of random non-contiguous months.

 

Any help greatly appreciated.

2 ACCEPTED SOLUTIONS
edhans
Super User
Super User

You should create a Date table and relate the date table to your data table. You can create an arbitrary date in your data table if you don't have the day. Use the first day of the month, or last day, or 15th, or whatever.

 

Then create whatever columns you want in the date table and use that as your slicer control. It will filter down to your data table. You can read more about date tables here, and I prefer to create dynamic date tables in Power Query so they are always complete, no matter how much new data gets added to your data set over time.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

VasTg
Memorable Member
Memorable Member

@willpage 

 

As far as i know, what you are asking is not there. Maybe change it to a date so that atleast the users can see a calender to pick a date.

image.png

 

If it helps, mark it as a solution

Kudos are nice too.

 

Connect on LinkedIn

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I also want a slider with two drop down like start date and end date and my column is in text format (2021 PD 04 ) please post A solution

VasTg
Memorable Member
Memorable Member

@willpage 

 

As far as i know, what you are asking is not there. Maybe change it to a date so that atleast the users can see a calender to pick a date.

image.png

 

If it helps, mark it as a solution

Kudos are nice too.

 

Connect on LinkedIn
edhans
Super User
Super User

You should create a Date table and relate the date table to your data table. You can create an arbitrary date in your data table if you don't have the day. Use the first day of the month, or last day, or 15th, or whatever.

 

Then create whatever columns you want in the date table and use that as your slicer control. It will filter down to your data table. You can read more about date tables here, and I prefer to create dynamic date tables in Power Query so they are always complete, no matter how much new data gets added to your data set over time.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors