The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi , could anyone tell me what is the power query formula to change the hour into hh:mm format
@Learner_SG I believe you would just use the divide method in Power Query and then change the type to Duration.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTICYmMgNlGK1SFLJBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [One = _t, Two = _t, Three = _t, Four = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"One", Int64.Type}, {"Two", Int64.Type}, {"Three", Int64.Type}, {"Four", Int64.Type}}),
#"Divided Column" = Table.TransformColumns(#"Changed Type", {{"One", each _ / 24, type number}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Divided Column",{{"One", type duration}})
in
#"Changed Type1"
@Greg_Deckler , thanks for the reply. I tried with your formula but it just displays one time only and it does not give different time values as per the time table.
My intention is that based on my hour value table which is in 24 hr format , I need to display it in the graph which will show as below.
When I used the time column which is hh:00 format which was created in dax it gives me the date also inside(31/12/1899)
even though I tried to change the column to time format. So I wanted to create the table in power query and try.
Hi @Learner_SG
Another limitation is that the slicer you want to have is a range slicer, but currently Power BI only has numeric range slicer and date range slicer. It only supports to put a numeric type column or a date type column into a slicer and switch it to Between mode, just like the screenshot you show. It doesn't support other data types or data formats.
Use the numeric range slicer in Power BI - Power BI | Microsoft Docs
You could raise an idea at Ideas (powerbi.com) and let other people vote it up.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
@Learner_SG There is no true Duration data type in Power BI even though it exists in Power Query. It is stored as a decimal number with the hours, minutes, seconds as /24, /24/60 and /24/60/60. So, you will need to use a custom format string along the lines of Chelsie Eiden's Duration. https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389