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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SuperSusa
Frequent Visitor

Duplicate index values - from quarterly to monthly

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. 

SuperSusa_1-1683541637272.png

 

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.

SuperSusa_0-1683541385611.png

 

 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

2 REPLIES 2
Einomi
Resolver II
Resolver II

@SuperSusa  was this helpful ?

 

PS : please mark this post as solution if it solved your problem, and we welcome Kudos 🙂

 

Einomi
Resolver II
Resolver II

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 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors