Show LAST REFRESH timestamp in a PUBLISHED report on POWERBI SERVICE - datetime

I already checked Stackoverflow for an answer, but I only found question related to showing a timestamp in PowerBI Desktop, which is pretty different from the behaviour in the PowerBI Service, e.g. see
How to display current date and time in power bi visuals?
Visualizing last refresh date in power bi
Why?
I don't want to see in my report the timestamp of the current date
and time, since I already have this in the status bar of my
operating system.
I don't want to see in my report the timestamp of
the last "report" refresh, when only the measures get updated (like
in the Service).
I don't want to see the timestamp of last re-import
of (most-likely unchanged) data in the Desktop/Service.
What I want to see in my report is the timestamp of the last "dataset" refresh in the Service, which cannot be achived by a measure, but a M-function only!
The problem now is that the Service runs in UTC time, while I'm of cause interested in local time, and all the M-functions to convert a datetimezone number only only accept a fixed time-shift in hours, but do not consider daylight savings.
How would a solution look like to properly overcome this deficit and to show the proper local time of the dataset refresh in a PBI Service report?!

For whatever reason, Microsoft hasn't built in native daylight saving handling yet but please vote for them to fix this here.
However, various people have suggested workarounds involving defining the dates/times when DST changes things or referencing an external oracle.
https://intellitect.com/convert-utc-local-time-daylight-savings-support-power-bi/
https://blog.crossjoin.co.uk/2017/03/28/daylight-saving-time-and-time-zones-in-m/
https://powerpivotpro.com/2019/01/dst-refresh-date-function-power-bi-service/
https://radacad.com/solving-dax-time-zone-issue-in-power-bi

As a workaround I've been pulling the proper local time from worldtimeapi.org so far, see e.g. this PowerQuery M-script:
let
Source = Json.Document(
Web.Contents("http://worldtimeapi.org/api/timezone/Europe/Berlin")),
#"Converted to Table" = Record.ToTable(Source),
#"Filtered Rows" = Table.SelectRows(
#"Converted to Table", each ([Name] = "datetime")),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Name"}),
#"Changed Type" = Table.TransformColumnTypes(
#"Removed Columns",{{"Value", type datetimezone}}),
#"Renamed Columns" = Table.RenameColumns(
#"Changed Type",{{"Value", "Europe/Berlin"}})
in
#"Renamed Columns"
However, I just realized that this has become somewhat obsolete meanwhile:
In the PowerBI Service switch the New Look to ON and then in the title bar next to the report name you get e.g. "Data updated 26/04/20" and in the drop-down menu you can even see the exact update time.

Related

D365FO Tile count on workspace doesn't work

Situation is next one:
I created several tiles. Every tile need to show count of records.
Tile "Expired Active Contracts" always shows zero.
There is created simple query with data source table Contract. Ranges are added (ContractStatus; Value: 2) and (ValidTo; Value: (LessThanDate(0)) )
When it's clicked on tile, it opens valid form with valid record, where contracts status is active (2) and ValidTo are any date before today's date, but count doesn't working.
Tried to recreate, tried several things but definitely nothing. ValidTo field is date field.
Some time ago I had a mistake very similar to yours in my dev environment, this steps help me to fix the error.
1 - Clear Usages Data.
2 - SysAdmin/Setup/Data cache/Tile data cache configuration. Select
the tiles which are running into this issue and then delete the
selected tiles.
3- In VS rebuilt and Synchronized the Solution.
4 - Finally refresh the Application browser.
Another thing is that a while ago there was a problem for tiles refresh
Issue 243278 Workspace tile does not update correctly when reusing the
same name
https://fix.lcs.dynamics.com/Issue/Details?bugId=243278&dbType=3&qc=68b6dc6804c9cea218daa102968c7acfcdfe6a990e80e0b5ec66b920a680fceb
I hope you find it useful

Powerapps - get stuck with UpdateContext

I am trying to build a PowerApp to log setup times of our machines by our fitters.
This is what my app looks like:
There are buttons named "Uhrzeit". Pressing these will write the current date and time into the Date/Time fields. I am using the following code:
UpdateContext({Total8:(Text( Now(); "[$-de-DE]dd/mm/yyyy hh:mm:ss" ))})
The Date/Time field is named Total8.
The code is working well but after saving the form and opening a new record the old data is still available in the fields. By clicking on the button "Zeiten zurücksetzen" I can "delete" the old data.
UpdateContext({Total8:""})
Problem: When I open one of the older records the old data is not available in the form. There is only the value of the last record. In the Common Data Service where my records are saved the values are correct.
As an example, I am saving this record:
When I open a new record, the values of the record 1 are still available. This should not be the case if my app worked properly.
For your Information:
If I enter the date/time without tapping the button, saving the record and opening a new record I don't have the problem. I think the "UpdateContext" code is not the code I should use here.
Can anyone help me solve the problem?
I don't think there's a problem with using the contexts in this way -- but remember that a context is just a variable. It isn't automatically linked to a datasource in any special way - so if you set it equal to Now(), it's going to keep that value until you do something different.
When you view an old record, you need to get the data from CDS and update your contexts to match the CDS data. Does this make sense?
Yeah thats my problem.
I want the variable to be linked to a datasource. Or is it possible to write the date/time into the fields without using a context variable?

Cloudkitty - Rating display issue

In my Devstack setup there was a issue in displaying details in the Rating section.
Pricing was configured correctly, During Instance creation Rate is displayed in the instance creation window.
But after creation of instance I am checking the Rating section for rates or cost.
It was not displaying the value as needed.
I checked the DB table (rated_data_frames) in Cloudkitty.
It doesn't have the necessary values immediately.
I was continuously checking for some hours consecutively.
But I can be able to see that Cloudkitty DB is getting updated with the values after some hours from instance creation.
That is after some hours, it is getting added in table regarding the Instance created.
So that in Front-end also it got displayed.
I want to know why it is happening.
Is there any solution for the same to get the results immediately.
Simply I need to get the results immediately in rating section.
I can be able to see that in cloudkitty.conf file section is there as follows:
# Rating period in seconds. (integer value)
#period = 3600
#wait_periods = 2
If changing this will help us.?

Database table in which WTPart or Change activity Maturity History is stored

I need to pull the date on which a WTPart was in inwork state or A CN was in published state.
I did my analysis and found that there should be a Maturity history table in database, but i ended up with a table called MaturityBaseline table which does not hold this information. I need guidance on which table this information is stored. Even in API com.ptc.windchill.enterprise.history.HistoryTablesCommands.maturityHistory(wtObject); they are using Maturity History class.
Have you tried this method from same class?
com.ptc.windchill.enterprise.history.HistoryTablesCommands.getLegacyLifeCycleHistory(LifeCycleManaged arg0);
I have never tried by myself though. Also check for HistoryRecord table in database whether it have any info related to this.
I know this question is may years old now, but I stumbled across it looking at how to find the history of a change issue/problem report.
My problem report has a number TA00025 and I want to find when it was completed. The enter_phase action will tell me whenever the state has changed. This SQL will tell me changes of state for the nominated change issue/problem report (the same object type in Windchill)
select LH.action, LH.state, LH.updateStampA2
from wcadmin.[wcadmin].ObjectHistory OH, wcadmin.[wcadmin].LifeCycleHistory LH,
wcadmin.wcadmin.WTChangeIssueMaster CIM, wcadmin.wcadmin.WTChangeIssue CI
where OH.idA3A5 = CI.idA2A2
and OH.idA3B5 = LH.idA2A2
and CI.idA3masterReference = CIM.idA2A2
and CIM.WTCHGISSUENUMBER = 'TA00025'
and LH.action = 'Enter_Phase'
For a WTPart the history all sits in the table WTPart which will have a full history for a part wth multiple records.

AppInventor: how to insert DateTime into Google Spreadsheet and show only recent DateTime

I am new to this forum so I hope I asking my question in the right place.
I have a problem inserting a datetime into a Google Spreadsheet from a form created in Appinventor2;
In app inventor2 I created a form that fills in a google spreadsheet. Basically I merged the Pizza Party example (http://appinventor.mit.edu/explore/ai2/pizzaparty.html) with this example http://puravidaapps.com/spreadsheet.php to use google spreadsheet instead of fusion table.
the user selects in how many minutes he wants his order and then sees all the orders in a table sorted by delivery time.
Problem A)
Firstly, i want to save the current datetime + the desired delay into the google spreadsheet and sort the table by this new datetime.
1) when i use the block "call clock format time" + "call clock addminutes" the spreadsheet is populated with a text, but then i can't sort the table by delivery datetime. in fact i believe the sorting is done on the number regardless of the am/pm or day of the month. so for example instead of having 4am, 6am, 2pm, 3pm i get : 2pm, 3pm, 4am, 6am.
2) I then tried to remove the block "call clock format time" and in the google form i kept the field format = text
but the google spreadsheet is populated with the following:
java.util.GregorianCalendar[time=1395531335908,areFieldsSet=true,lenient=true,zone=Europe/Dublin,firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2014,MONTH=2,WEEK_OF_YEAR=12,WEEK_OF_MONTH=4,DAY_OF_MONTH=22,DAY_OF_YEAR=81,DAY_OF_WEEK=7,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=11,HOUR_OF_DAY=23,MINUTE=35,SECOND=35,MILLISECOND=908,ZONE_OFFSET=0,DST_OFFSET=0]
3) I then tried to remove the block "call clock format time" and in the google form I changed the field format = time
but then the google spreadsheet isn't populated with anything.
4)I tried using the segment block, but after a while I realised the block "format time" actually returns this format: "hh:mm:ss AM/PM"
so selecting the 5 characters is not good enough because it does not take into account of the am/pm element as well as the day of the month.
5) I found a temp solution by defining the desired delivery time as a new global variable, and extracting a string in the format hh:mm by joining the blocks ".hour instant" and ".minute instant".
However this is not a final solution because what i extracted is of course a string of text and when sorting, 01:10 will be always considered smaller than 23:50 for example, regardless of the date.
So is there a way of actually saving in the google spreadsheet not a string of text, but actually the date and time?
Problem B)
Secondly, I would like to filter/show only the rows of the google spreadsheet have a delivery time expired by no more than 1 hour (as well as orders with delivery time in the future e.g. in 2 hours from now()).
I tried using some Google Visualization API Query Language commands, altering the url of the google spreadsheet (like WHERE "now() - Delivery Time < 60 mins)" (cannot remember the exact code I wrote) but unsucessfully.
Would anyone know how to filter my results?
thanks in advance
alterettore
So there's a few things to note.
If you're using Taifun's example as you mention, you'll notice that when you submit data to Google Spreadsheets using a form, the first column is always a timestamp, even if you're not submitting a date or time. Trying to send the current date/time is redundant - go ahead and make use of what Google provided.
Google Spreadsheets (and Excel) store Date/Time as a number. If you want to store a date in GS, the best way to do so is not formatted text, but by sending a number. Use AppInventor to calculate the number you need. For example, today (April 27) in GS is 41756. Noon today would be 41756.5
To generate this number, start with AI's Millisecond function. NOTE: Both GS and AI use milliseconds, but they have different 0 points, so you have to manipulate the result a bit. The formula I've used in AI in the past is this:
GS Date/Time = (Clock1.GetMillis(Clock1.Now) / 86400000) + 25569
Hope this helps!

Resources