This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I have a few hours of beginning and end, and I want to generate a list to later expand in rows, but when the hours pass to the next day I need a list to be generated until 23 hours and then to start at zero and reach the end.
| Start | End | Expected result |
| 23 | 1 | {23,0,1] |
| 22 | 0 | [22,23,0} |
| 23 | 23 | {23} |
| 22 | 23 | {22,23} |
I made this code, but didn't work
let
Origen = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjJW0lEyMFSK1QGyjUBsAwgbJA4k4OIgdiwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Start = _t, End = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Origen,{{"Start", Int64.Type}, {"End", Int64.Type}}),
#"Personalizada agregada" = Table.AddColumn(#"Tipo cambiado", "List", each try {[Start]..[End]} otherwise {[Start]..23,0..[End]}),
#"Se expandió Personalizado" = Table.ExpandListColumn(#"Personalizada agregada", "List")
in
#"Se expandió Personalizado"
*pd: excuse me if I have bad english, is not my native language
Solved! Go to Solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjJW0lEyVIrVATKNgEwDCBMkCiTgwiB2LAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Start = _t, End = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Start", Int64.Type}, {"End", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [End]<[Start] then List.Transform({[Start]..[End]+24}, each if _>=24 then _-24 else _) else {[Start]..[End]}),
#"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text})
in
#"Extracted Values"
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjJW0lEyVIrVATKNgEwDCBMkCiTgwiB2LAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Start = _t, End = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Start", Int64.Type}, {"End", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [End]<[Start] then List.Transform({[Start]..[End]+24}, each if _>=24 then _-24 else _) else {[Start]..[End]}),
#"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text})
in
#"Extracted Values"
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.