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 moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hello I'm from Brazil, I have a table in the medical certificate power query, I have the following columns: "Part of the Body"; "Initial date"; " "End Date" on the same line, I would like the dates to be only in a column repeating the information "Part of the Body" but the dates to be filled from the start date to the end date.
| Setor | ParteCorpo | direita/Esquerda | data inicial | data final |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 01/10/2022 | 10/10/2022 |
| PRODUÇÃO | PULSO | ESQUERDA | 02/10/2022 | 05/10/2022 |
| PRODUÇÃO | LOMBAR INFERIOR | 10/10/2022 | 21/10/2022 |
| Setor | ParteCorpo | direita/Esquerda | data inicial |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 01/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 02/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 03/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 04/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 05/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 06/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 07/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 08/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 09/10/2022 |
| PRODUÇÃO | BRAÇO INFERIOR | DIREITA | 10/10/2022 |
| PRODUÇÃO | PULSO | ESQUERDA | 02/10/2022 |
| PRODUÇÃO | PULSO | ESQUERDA | 03/10/2022 |
| PRODUÇÃO | PULSO | ESQUERDA | 04/10/2022 |
| PRODUÇÃO | PULSO | ESQUERDA | 05/10/2022 |
| PRODUÇÃO | LOMBAR INFERIOR | 10/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 11/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 12/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 13/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 14/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 15/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 16/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 17/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 18/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 19/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 20/10/2022 | |
| PRODUÇÃO | LOMBAR INFERIOR | 21/10/2022 |
Solved! Go to Solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCgjydwk93H642V9JR8kpyPFwu7+Cp5+ba5CnfxBQxMUzyNUzxBHIMtQ3NNA3MjAyArEN4JxYHTQzAkJ9gkG0a3BgqGuQC0irEZJWU9w6ffx9nRyDkG1HtQpoEMIRsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Setor = _t, ParteCorpo = _t, #"direita/Esquerda" = _t, #"data inicial" = _t, #"data final" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Setor", type text}, {"ParteCorpo", type text}, {"direita/Esquerda", type text}, {"data inicial", type date}, {"data final", type date}}, "pt-BR"),
Expanded = Table.ExpandListColumn(Table.CombineColumns(#"Changed Type", {"data inicial", "data final"}, each List.Dates(_{0}, Duration.TotalDays(_{1}-_{0})+1, #duration(1,0,0,0)), "Date"), "Date")
in
Expanded
| 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("i45WCgjydwk93H642V9JR8kpyPFwu7+Cp5+ba5CnfxBQxMUzyNUzxBHIMtQ3NNA3MjAyArEN4JxYHTQzAkJ9gkG0a3BgqGuQC0irEZJWU9w6ffx9nRyDkG1HtQpoEMIRsbEA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Setor = _t, ParteCorpo = _t, #"direita/Esquerda" = _t, #"data inicial" = _t, #"data final" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Setor", type text}, {"ParteCorpo", type text}, {"direita/Esquerda", type text}, {"data inicial", type date}, {"data final", type date}}, "pt-BR"),
Expanded = Table.ExpandListColumn(Table.CombineColumns(#"Changed Type", {"data inicial", "data final"}, each List.Dates(_{0}, Duration.TotalDays(_{1}-_{0})+1, #duration(1,0,0,0)), "Date"), "Date")
in
Expanded
| 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! |
NewStep=#table(List.RemoveLastN(Table.ColumnNames(PreviousStepName)),List.TransformMany(Table.ToRows(PreviousStepName),each List.Dates(_{3},Duration.Days(_{4}-_{3}),Duration.From(1)),(x,y)=>List.RemoveLastN(x)&{y}))
Check out the May 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.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 3 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 3 | |
| 3 | |
| 3 |