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

The Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more

Reply
Anonymous
Not applicable

Simplify this steps

Hi, I have to use 6 column to create 3 date column that I can use later. This is done with multiple steps one column t the time.

How can I simplyfy this? Is there any tips?

 

#"Promoted Headers" = Table.PromoteHeaders(#"Emner - Detaljert oversikt - Em_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Undervis. årstall", Int64.Type}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","HØST","8",Replacer.ReplaceText,{"Undervis. termin"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","VÅR","1",Replacer.ReplaceText,{"Undervis. termin"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value1",{{"Eksamen årstall", Int64.Type}, {"Undervis. termin", Int64.Type}}),
#"Replaced Value2" = Table.ReplaceValue(#"Changed Type1","HØST","8",Replacer.ReplaceText,{"Eksamen termin"}),
#"Replaced Value3" = Table.ReplaceValue(#"Replaced Value2","VÅR","1",Replacer.ReplaceText,{"Eksamen termin"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Replaced Value3",{{"Eksamen termin", Int64.Type}, {"Kull årstall", Int64.Type}}),
#"Replaced Value4" = Table.ReplaceValue(#"Changed Type2","HØST","8",Replacer.ReplaceText,{"Kull termin"}),
#"Replaced Value5" = Table.ReplaceValue(#"Replaced Value4","VÅR","1",Replacer.ReplaceText,{"Kull termin"}),
#"Changed Type3" = Table.TransformColumnTypes(#"Replaced Value5",{{"Kull termin", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type3", "Und_Dato", each Date.ToText(#date([Undervis. årstall], [Undervis. termin], 1))),
#"Changed Type4" = Table.TransformColumnTypes(#"Added Custom",{{"Und_Dato", type date}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type4", "Eksamen_Dato", each Date.ToText(#date([Eksamen årstall], [Eksamen termin],1))),
#"Changed Type5" = Table.TransformColumnTypes(#"Added Custom1",{{"Eksamen_Dato", type date}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type5", "Kull_Dato", each Date.ToText(#date([Eksamen årstall], [Eksamen termin], 1)))
in
#"Added Custom2"

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

#"Promoted Headers" = Table.PromoteHeaders(#"Emner - Detaljert oversikt - Em_Sheet", [PromoteAllScalars=true]),
#"Replaced Value" = Table.ReplaceValue(#"Promoted Headers","HØST","8",Replacer.ReplaceText,{{"Undervis. termin"},{"Eksamen termin"},{"Kull termin"}}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","VÅR","1",Replacer.ReplaceText,{{"Undervis. termin"},{"Eksamen termin"},{"Kull termin"}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value1",{{"Undervis. årstall", Int64.Type},{"Eksamen årstall", Int64.Type}, {"Undervis. termin", Int64.Type},{"Eksamen termin", Int64.Type}, {"Kull årstall", Int64.Type},{"Kull termin", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Und_Dato", each Date.ToText(#date([Undervis. årstall], [Undervis. termin], 1))),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Eksamen_Dato", each Date.ToText(#date([Eksamen årstall], [Eksamen termin],1))),
#"Added Custom2" = Table.AddColumn(#"Added Custom1", "Kull_Dato", each Date.ToText(#date([Kull årstall], [Kull termin], 1)))
#"Changed Type5" = Table.TransformColumnTypes(#"Added Custom2",{{"Eksamen_Dato", type date},{"Und_Dato", type date},{"Kull_Dato", type date}})
in
#"Changed Type5"

Your Kull_dato formula was wrong.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

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.

Top Kudoed Authors