Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi All,
I'm using an XML feed as a datasource and transforming the data to merge it with another local data source. I have a time field from the XML that is in the format "9:30", "10:30", "18:00" etc. Is there a way to add the 0 prefix to the "9:30" time so that it is "09:00"?
Thanks
Solved! Go to Solution.
Hi @cmcnally,
If the column is set to type time as well you can use this function:
Time.ToText([ColName], [Format="hh:mm", Culture="en-US"])
Note that this will convert the value to type text:
When the value is already stored as text, then use Text.PadStart, as shown here:
I hope this is helpful
In Power Query, if the data is typed as `time`, it will display in the format of your computer's windows regional settings. If you load it into Power BI, you can set the format for that column (`hh:mm`)
If it is typed as `text`, then you can use the text manipulations discussed by @m_dekorte , but you won't be able to perform any calculations.
Hi @cmcnally,
If the column is set to type time as well you can use this function:
Time.ToText([ColName], [Format="hh:mm", Culture="en-US"])
Note that this will convert the value to type text:
When the value is already stored as text, then use Text.PadStart, as shown here:
I hope this is helpful
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
31 | |
31 | |
20 | |
15 | |
12 |
User | Count |
---|---|
21 | |
20 | |
16 | |
10 | |
9 |