Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I am new to PowerBi and this is my second time posting here. What a fantastic forum! Thank you all for your time and sharing your knowledge, you really help people out there a lot!
So I have this dataset where all the values are monthly indexes and market prices.
Now I would like to include data that comes only quarterly. Source is web, its quite a long M code generated by a service that provides M codes for national statistics in Northern Europe. I usually import and then continue working with DAX.
I would like to add a column for "month" which duplicates the index value, like below:
Byggekostnadsindeks year month
89,2 2000 01
89,2 2000 02
89,2 2000 03
90,2 2000 04
90,2 2000 05
90,2 2000 06
91,2 2000 07
ect.
Do you know how to do this?
Best regards
@SuperSusa was this helpful ?
PS : please mark this post as solution if it solved your problem, and we welcome Kudos 🙂
Hi @SuperSusa
If I understood correctly, you can try the M code below
let
Source = Excel.CurrentWorkbook(){[Name="Tableau1"]}[Content],
#"Colonne conditionnelle ajoutée" = Table.AddColumn(Source, "Personnalisé", each if [Quarter] = "Q1" then "M1 M2 M3" else if [Quarter] = "Q2" then "M4 M5 M6" else if [Quarter] = "Q3" then "M7 M8 M9" else if [Quarter] = "Q4" then "M10 M11 M12" else null),
#"Fractionner la colonne par délimiteur" = Table.ExpandListColumn(Table.TransformColumns(#"Colonne conditionnelle ajoutée", {{"Personnalisé", Splitter.SplitTextByDelimiter(" ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Personnalisé"),
#"Type modifié" = Table.TransformColumnTypes(#"Fractionner la colonne par délimiteur",{{"Personnalisé", type text}}),
#"Colonnes supprimées" = Table.RemoveColumns(#"Type modifié",{"Quarter"}),
#"Texte extrait après le délimiteur" = Table.TransformColumns(#"Colonnes supprimées", {{"Personnalisé", each Text.AfterDelimiter(_, "M"), type text}})
in
#"Texte extrait après le délimiteur"
Hope it helps, you may need to tweak it a little bit
PS : please mark this post as solution if it solved your problem, and we welcome Kudos 🙂