Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Unpivot Multiple Columns and Make One Repeated

I have a query where I"m taking a table (RatesData) that's formatted like this:

EffectiveDateRate_001moRate_002moRate_003mo
4/6/2024.053.054.055
5/7/2024.051.052.053

I currently have a query that unpivots the table:

= Table.UnpivotOtherColumns(#"SourceData", {}, "Term", "Rate")

Results:

TermRate
EffectiveDate4/6/2024
Rate_001.043
Rate_002.044
Rate_003.045
EffectiveDate5/7/2024
Rate_001.051
Rate_002.052
Rate_003.053

 

I would like to make the "EffectiveDate" it's own column and then repeat the date for those corresponding rates like this:

EffectiveDateTermRate
4/6/2024Rate_001.043
4/6/2024Rate_002.044
4/6/2024Rate_003.045
5/7/2024Rate_001.051
5/7/2024Rate_002.052
5/7/2024Rate_003.053
  • Anonymous if you click on column "EffectiveDate", go to Transform > arrow beside Unpivot columns > unpivot other columns, it will give you 3 columns:
    1) EffectiveDate
    2) Attribute > rename to "Term"
    3) Value > rename to "Rate"

     

     


    Cheers,
    Nemanja Andic

2 Replies

  • nandic's avatar
    nandic
    Icon for Resident Rockstar rankResident Rockstar

    Anonymous if you click on column "EffectiveDate", go to Transform > arrow beside Unpivot columns > unpivot other columns, it will give you 3 columns:
    1) EffectiveDate
    2) Attribute > rename to "Term"
    3) Value > rename to "Rate"

     

     


    Cheers,
    Nemanja Andic