Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello !
I would like to change the hour in the query. How can I do it?
Thank you 🙂
Solved! Go to Solution.
Hi @Pucca121,
Select 'Edit Queries' from arrow down.
Open your power query code via clicking on 'Advanced Editor'
In your code, you just need to add the highlighted part. You should replace the #"Changed Type" and "Date" with your own scenario.
Regards,
Yuliana Gu
It worked. I will see if my problem is resolved 🙂
Thank you sooo much!
P.
There are many ways to change the hour. What would be the desired result?
The solution may depend on wether any time zones are involved or not.
Only one time zone is involved. I would like to put it at 00:01:00 (one minute past midnignt)
Thank you
P.
Hi @Pucca121,
As @MarcelBeug suggested, this query code works fine in my test, I could get the desired result. If it also apply to your scenario, please kindly mark it as an answer so that someone else having similar requirement can find the solution more easily. If not, please feel free to ask.
Regards,
Yuliana Gu
In the query editor (M) you can add a duration of 1 hour and 1 minute, e.g. with the following code, in which "PreviousStep" is the name of your previous step in the query code:
= Table.TransformColumns(PreviousStep,{{"DateTime", each _ + #duration(0,1,1,0), type datetime}})
Hello @MarcelBeug
Where do I put this code? And I don't understand what is my PreviousStep.
I never did this type of tranformation in the query editor.
Thank you so much for your help!
P.
Hi @Pucca121,
Select 'Edit Queries' from arrow down.
Open your power query code via clicking on 'Advanced Editor'
In your code, you just need to add the highlighted part. You should replace the #"Changed Type" and "Date" with your own scenario.
Regards,
Yuliana Gu
It doesn't work -...-
#change type is the name of the column ?
#date is the category ?
and what did you put behind the "=" sign?
Do you have "to close and apply" to make it work and see a change in the column ?
Thank you so much!
Regards,
Yuliana Gu
Also notice that the identifier after "in" must be the last step name before "in".
Hello!
I made the changes and it returned me this error. Any ideas why?
Thank you very much
P.
Apparently you either overlooked or misunderstood my previous post.
Just change the identifier after "in" to #"Renamed Columns".
I modified like this and it returned me this error -.....-
Thank you so much for your time!
In the last step you use function Table.RenameColumns. This should be Table.TransformColumns.
haaa ok! Much clearer now, thank you!!
P:
You need to add a comma at the end of your line, numbered 17.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
79 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
82 | |
48 | |
48 | |
48 |