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
Anonymous
Not applicable

single date picker in powerbi

hi

 

i need to select single date in my report so that business have  greater interaction with the date visual . I know that single date  picker will be vailable in list or dropdown but i dont need that since i have the data for long dates and business finds it hard for selection and where you don't have search option too .

 

If we don't have anything can you guide if i select the from date in the date slicer ,is there a way that end date is by defualt selcted from to date and so that i can achieve this functionality .

date.jpg

can anyone help me here ?

21 REPLIES 21
torsten
Helper I
Helper I

Here a short description how this can be achieved. Hope this helps 🙂

RCS3
Frequent Visitor

Sorry for re-emerging and old post. I have a similar requirement where the single date picker should show specific columns from the data source on a matrix. I tried the method provided in NEXT LEVEL Power BI Date Picker! - YouTube link. The date picker works perfectly but we should have a measure to call required columns for the matrix to visualize which I do not know how to do since I'm a beginner. Any suggestions anyone?

Here a short description how this can be achieved.

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

Look at this video from Guy in a Cube.

 

https://www.youtube.com/watch?v=zhWtU0DynCk

 

You will need to use TreatAs for some of your measures.

 

 

Regards,

Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

andres777
Advocate III
Advocate III

I really do not like some solutions that involve covering up date controls to make it look like it works fine.

We had many users pushing us (BI Analyts) to come up with a more professional solution that works well and looks good.

 

So I had to write my own custom Visual DatePicker (and go through the steep learning curve to learn all: Node Js, Ms Code, JavaScript, XML Parameters, Syncfusion parameters, Power BI compilation process, Sync calendars, etc) it took me around 2 months or more to come up with something end users would love and accept to use.

 

Since I didn't want to reinvent the wheel, I searched and searched all over to find some source code I could re-use inside Power BI environment. Because Power BI acts and works like a website,  I thought I should look for javascript components.  So I found and purchased the SyncFusion Essential JS 2 libraries, just to use one control, the datePicker, the other 59 controls are available for us to use at another time if we want...

A sample of how their calendar datepicker works in on their demo page... Link

Disclaimer : I don't work for SyncFusion or get paid by them to say these comments, I'm just a frustrated user that wanted a professional solution inside Power BI, which according to most users, should be out by now.

 

Clicking on a Day will select that date, clicking on "May 2020" will allow you to select the Month, and further down, clicking on the "2020" will allow you to select the Year. Very simple, elegant and professional.

 

picking a day ;

image.png

picking a Month

image.png

picking a Year :

pick a yearpick a year

 

This is what mine looks inside Power BI...

Users click on the Calendar Icon, and I bring the bookmark Page that contains the 

DatePicker Control.  Allowing them to select ONE, single date.

(I removed some labels from the grid, to protect the inocent :)...)

image.png

image.pngI created this custom vizual + icon image

Hope this helps some people...

 

Andres

Hey @andres777 

Great job on creating the single date picker. This is exactly what I was looking for. 
Would you be able to provide visual file or the code you used together with the instructions on how to implement it?

 

Thanks!

Hi Andres, this is just what I'm looking for! thanks for the hardwork. Could you please share me the name of your custom visual? because I can't find it,

Kind regards,
Gaby

Hi Gaby,

I wrote the custom vizual myself, with the help of a Syncfusion library that contains the graphics in Node js

Hi @andres777,

 

your solution looks very promising. Would you mind to share it with us? I'd love to use your visual too, it would be great if you could publish your code or your pbiviz file anywhere. 🙂

 

Best,

Christoph

Hi All,

 

I'm glad to share the code for this custom date picker,

Because it was done as a one-time-only, and as a rush project

there are some things I would love to change :

  • It defaults to today()-2 days, when you open the calendar in a report (as requested by my end users)
  • It selects values from a table called Calendar, which I used to synchronize data from other tables in my model.
  • If you need to re-compile, it would need the Syncfusion libraries which are about $450/yr
  • Compiled viz can be distributed, according to syncfusion website.

When I get a bit more time, I would like to program more features so parameters can be entered by users for :

default dates, Date Table, specific date field to use, color of calendar, display mode, etc

 

Thanks for all

Andres777 at gmail

 

Hi Andres,

 

can you share your compiled visual file or would this violate any license restrictions?

 

Best,

Christoph

jsh121988
Employee
Employee

Search isn't available on Date type, but it is available on Text type. Create a new calculated column, and set it to a type of Text. You can use Sort By another sorted column if you wan to get fancy with the format output.

 

DateText = FORMAT([Date], "yyyy-MM-dd")
Anonymous
Not applicable

@jsh121988  : is there any similar visual which you could aware of  for single date picker . Thanks for reply

Hi @Anonymous ,

May be your could have a try with before or after slicer in Power BI.

 

before slicer.png

 

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-piga-msft  before or after is not for one date right?. in your below screenshot it takes the range of data from 1/1/2019 to 3/6/2019 . But i need in the same calendar visual which gives the data for 3/6/2019 . I want the user to have claendar visual not the drop down or list format .

Before or After can work, but you need to create explicit measures that use the LASTDATE() or FIRSTDATE() as a filter, depending on before or after repectively. My only conern is that it may confuse users, and it can possibly give you more overhead if you need to create a measure for everything (even though I intentionally create measures for everything).

MyMeasure = 
CALCULATE(
    SUM(Table1[Col1]),
    LASTDATE(Table1[Date])
) 
Anonymous
Not applicable

@jsh121988  : yes this creates uncessary confusion .

Anonymous
Not applicable

Try this: 

Build a DATE PICKER in Power BI Desktop

#GuyInACube

 

https://youtu.be/zhWtU0DynCk

You need to wait until the end to see it work but it is a pretty good option.

Requires date specific measures but should be OK for most requirements.

Hi @Anonymous ,

By my test and research, I'm afraid that we cannot achieve your desired slicer in Power BI currently.

You could vote this similar idea which is Started.

Best Regards,

Cherry

 

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

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.

Top Solution Authors