Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi All,
Is there a way to sort my date in 24h day from 18:00 start to 17:00 end and not from 00:00 to 23:00
So in other words like this...
I am trying to structure my X axis by hour but in a specific order. So by default Power BI would arrange my hours from 0 - 23
or it would kind of just mix them up as below.
The result i am trying to acheive is like this:
Please help me in the right direction to replicate the second visual
Solved! Go to Solution.
Hi @Freeseman ,
Please try:
First, create a new column to help sort:
Here is the M code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tc/JDcAwCATAXnj7YRYfoRYr/bcRsY4Ev7E4Fp8jXZq4yduOaHCRCHbSgiBHcJMzOMiVYzt7n+AkvUREnPa7WRno1yi23KijDsxSWLWw64PReu2lgJ5HQ7MJyH/B/jveDw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Time = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Time", Int64.Type}, {"Value", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Time]>=18 then [Time]-18 else [Time]+6),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Custom", Int64.Type}})
in
#"Changed Type1"
Then use sort by column:
Choose sort by time in the visual:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Freeseman ,
Please try:
First, create a new column to help sort:
Here is the M code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tc/JDcAwCATAXnj7YRYfoRYr/bcRsY4Ev7E4Fp8jXZq4yduOaHCRCHbSgiBHcJMzOMiVYzt7n+AkvUREnPa7WRno1yi23KijDsxSWLWw64PReu2lgJ5HQ7MJyH/B/jveDw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Time = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Time", Int64.Type}, {"Value", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Time]>=18 then [Time]-18 else [Time]+6),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Custom", Int64.Type}})
in
#"Changed Type1"
Then use sort by column:
Choose sort by time in the visual:
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2023 Power BI update to learn about new features.