Questions on jquery DatePicker - jquery-ui-datepicker

I have a couple of simple questions on DatePicker...
Is it possible for me to select a time along with my date? How can I do that?
I need to make sure my user can not pick a date that happens before a certain time, and I also need to make sure that the user can select dates further back in history that is the norm...
How can I do that?

No, the date picker is specifically for dates, no times. You can always build one separately. Just Google it. Also, what do you mean by a date before a certain time? Why not just limit the dates minDate and maxDate options?

Related

Default Silcer Selection in Power BI (latest date)

I have one query can somebody please tell how to show Latest date in a date format
So basically, I want to show the latest date selected by default and if the user wants to select other dates they can change manually but the latest date should be in a date format
Date = IF('Query'[Date] = MAX('Q'[Date]), "Latest Date", FORMAT('Query'[Date], "MM-DD-YYYY"))
Please help to show the latest date in a date format
eg: MM-DD-YYYY
First of all, unless you use a static value like "Latest Date" as you have done in the column above, you will not be able to set the slicer to the latest date. However, you can have your report behave as though the latest date were selected if nothing is selected.
Based on your formula, I am assuming that the table Query holds the static latest date of the model and that the table Q is your calendar table.
Create these measures:
Pivot Date = MAX(Query[Date])
Earliest Selected Date = IF(ISFILTERED(Q[Date]),MIN(Q[Date]),[Pivot Date])
Latest Selected Date = IF(ISFILTERED(Q[Date]),MAX(Q[Date]),[Pivot Date])
Now the hard part is you need to write all your measures to use the date range defined by Earliest and Latest Selected instead of just leaving it up to the slicer to control the dates. This allows you to control what's displayed when nothing is selected.
ExampleMeasure =
var start_date = [Earliest Selected Date]
var end_date = [Latest Selected Date]
return
CALCULATE([Some Measure], removefilters(q[date]), q[date] >= start_date, q[date] <= end_date)
One of the drawbacks of this approach is that you may be depending on your slicer to show the user which dates are selected. To overcome that, add an unobtrusive visual that shows the dates in use. I like to use a Multi Row Card for this and place it in the top right corner of every page. I include these measures: Available From, Available to, Selected From and Selected To. That way viewers know how much data is in the report overall, and they know what's selected at this time. Placing this in the same place on every page in every report is an excellent practice as your viewers will become habituated to consulting this spot for date info.
Finally, I want to point out that you could implement this logic with calculation groups, and that is how I would do it in one of my own reports. Doing so would eliminate the need to modify all the measures you already have, but it would introduce a number of complexities. Calculation Groups have a big learning curve, so you need to be prepared for that journey. The alternative I have suggested will be quicker than getting up to speed on Calculation Groups. However, you should learn how to use them. I highly recommend everything at sqlbi.com on this topic. They have an excellent search tool on the site to find all their content related to Calculation Groups.

Including Re-occurring Time Saved in Date Slicer Output

I am looking into utilising PowerBI to identify time saved due to various Projects. People will add the projects to a Sharepoint List which then feeds into PowerBI.
PROJECTs Table:
Project Tite, Desc, Hours/Month Saved, StartDate, EndDate, Repeat? (T/F)
[Some Projects only save a fixed 10 or so hours, others save time per month (indicated by the Repeat Column)]
I've created two measures, RUNTIME determining how long the project has run in months ((TodayDate - StartDate)/30) as well as TIMESAVED which is the total hours saved from that specific project (RUNTIME*Hours/Month Saved).
Whilst this works, it has a pretty big limitation. When selecting a range, say 01/01/2017 - 01/01/2018, any projects with a start date before that range are excluded. However these maybe on-going, meaning the time saved by this project during the range needs to be added.
I've attempted to find a solution to this, however I keep getting stuck at requiring the the filter dates from the slicer, however I'm not certain this is possible. I need those projects with on-going savings to have the savings during the period given to be counted as well.
Possible alternative maybe to create a Month/Year column per Month/Year with a custom formula per column to determine that projects Hours saved for that Month/Year however this seems inefficient, at that point back to Excel might be better.
Any ideas / suggestions would be greatly appreciated, currently running through any ideas to solve but keeps coming back to needing that value specified by the filter. Cheers in advance for any advice tackling this :)
See also: https://community.powerbi.com/t5/Desktop/Re-occuring-Savings-over-Time-with-Time-Date-Slicer/m-p/346100
Unfortunately, there is no current simple solution to this problem out-of-the-box with Power Bi. All of the slicers seem to handle dates as a single point in time. They suffer in that if you are dealing with any items that span a Start and End date (like your projects, and most of my data examples) they only take one of the dates as the input. The slicers need to accept an optional end date in our case and then perform a simple date span overlap logic to determine the items that match.
I tried to solve your problem with out-of-the-box Power Bi Desktop slicers and a custom visual Timeline Slicer I found at the store with no luck earlier this month. Out of frustration, I posted a question in the Power Bi forums for suggestions.
The final suggestion from the forums I got was to "use two Filters at Filter pane". But I am not satisfied with this answer.
The Timeline Slicer code is open source and when I get more time (ha ha), I would like to make this change to the Timeline Slicer and publish it back to the repository for everyone to use.
I will monitor this question and the forum to see if a solution emerges in the future.
You can use Timeline Storyteller. you can create your time line and add a couple Slicers for Start and End. It will split by day the dates and you won't miss any data.

How to use REGEX patterns to return day of the week if a date is entered?

I am trying to create something that will populate the day of the week in one cell based on a date entered in another, BUT in Master Data Services. I know I will need to do this in a business rule and apply it to the attributes. I am wondering if this can be don using REGEX patterns or any other clever method. So, for example if I have a column with 12/21/2016 in it, I want the next column to say "Wednesday". Thanks!
The simplest way would be using sql and use a calculated column or directly in a view. I'm not that familiar with MDS so there might be a better solution (or not even possible).
alter table mytable add weekday as DATENAME(dw,fieldname) persisted
Do never try to do your own date/time functions, you will fail

Can I append data to the powerBI dataset rather than replace the whole dataset?

I have 40 million rows in my dataset. Each day I may get an extra 100 rows. Obviously I don't want to have to import the whole 40 million each time I do a data refresh. Is it possible to do an incremental refresh where only the new rows are added?
I don't think incremental update as you describe it is possible yet.
It looks like you can push rows with Power BI REST API, if you're happy to switch to that.
However, you might find this workaround useful:
Split your table and query into two: where date <= 'somedate' and where date >'somedate'
Add an "empty query", use Table.Combine to join your two subtables. Use this as your main table.
Whenever you need to refresh, only refresh the second query (the one with where date >'somedate').
Every once in a while, when that second query starts taking a long time, change somedate to the current date and do a full refresh.
The feature has now been implemented and is called Incremental refresh. Currently it is a premium only feature.

Show link on specific time and date?

I want to show a link at a specific time and date.
Is it possible to get a value from a table and show that link like this
#MonthAsString(month)# #year#
on a specific time and date?
From the table I'm getting the record from a form I submit and there it create 1 record (which will
be enter once a month) I use this table to output the winners which I want to show in the link above
but I only want to show that link at a specific time and date. Not sure if the best way to do this
is in the form I submit. I have a column which the user submit the time and date they want the link to show
and that goes into the table. Maybe I don't need to insert it into the table , Is there a better way to do this?
Putting it into a table is a good solution then you just need to use a cfif. Note that now() would need to represent the exact time and if you're going to match between certain times you would need to update your if as well.
<cfif now() GT qryName.myDate>
#MonthAsString(month)# #year#
</cfif>