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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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