Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Syndicate_Admin
Administrator
Administrator

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.

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.

 

SetorParteCorpodireita/Esquerdadata inicialdata final
PRODUÇÃOBRAÇO INFERIORDIREITA01/10/202210/10/2022
PRODUÇÃOPULSOESQUERDA02/10/202205/10/2022
PRODUÇÃOLOMBAR INFERIOR 10/10/202221/10/2022
 
below, how the table should look. Filling the date ranges in each row 😀
 
SetorParteCorpodireita/Esquerdadata inicial
PRODUÇÃOBRAÇO INFERIORDIREITA01/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA02/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA03/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA04/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA05/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA06/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA07/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA08/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA09/10/2022
PRODUÇÃOBRAÇO INFERIORDIREITA10/10/2022
PRODUÇÃOPULSOESQUERDA02/10/2022
PRODUÇÃOPULSOESQUERDA03/10/2022
PRODUÇÃOPULSOESQUERDA04/10/2022
PRODUÇÃOPULSOESQUERDA05/10/2022
PRODUÇÃOLOMBAR INFERIOR 10/10/2022
PRODUÇÃOLOMBAR INFERIOR 11/10/2022
PRODUÇÃOLOMBAR INFERIOR 12/10/2022
PRODUÇÃOLOMBAR INFERIOR 13/10/2022
PRODUÇÃOLOMBAR INFERIOR 14/10/2022
PRODUÇÃOLOMBAR INFERIOR 15/10/2022
PRODUÇÃOLOMBAR INFERIOR 16/10/2022
PRODUÇÃOLOMBAR INFERIOR 17/10/2022
PRODUÇÃOLOMBAR INFERIOR 18/10/2022
PRODUÇÃOLOMBAR INFERIOR 19/10/2022
PRODUÇÃOLOMBAR INFERIOR 20/10/2022
PRODUÇÃOLOMBAR INFERIOR 21/10/2022
 
Thanks!!
 
 
1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

 

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

 

CNENFRNL_0-1665133173227.png


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!

View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

 

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

 

CNENFRNL_0-1665133173227.png


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!

wdx223_Daniel
Community Champion
Community Champion

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}))

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Users online (3,107)