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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Transformation

Hi,  I am new to PowerBI.  

I want to take Month and Year ( here Jul/Jun 20)  from Row1  in Columns . How is that Possible?

  

S.NONameRankJoining dateStatus20-Jul-2020-Jun-20
1ABCA13-Jul-20Active300300
2CDEA26-Jul-20Active400400

 

 

 

 

 

1 ACCEPTED SOLUTION
nandic
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

If you would like to convert data from columns Jun-2020 and Jul-2020 into rows so that you could use it in report, below are steps.
In Power Query select these 2 columns and then choose unpivot columns > unpivot selected columns.
This way you will have new column which will contain values for both Jun-2020 and Jul-2020 and you will be able to compare them on the report.
Before unpivot.PNG

Before unpivot - unpivot.PNG

After unpivot.PNG

Cheers,
Nemanja

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Use the Unpivot transform. Make sure not to specify the columns that you actually want to target, as these may change.

 

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXJ0cgaRIKaxrldpjq6RAYifXJJZlgoSMzCAkrE60UpGQLaziytIAYhphkWDCVgDiIyNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [S.NO = _t, Name = _t, Rank = _t, #"Joining date" = _t, Status = _t, #"20-Jul-20" = _t, #"20-Jun-20" = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"S.NO", "Name", "Rank", "Joining date", "Status"}, "Attribute", "Value")
in
    #"Unpivoted Other Columns"

 

 

 

If stored as date format, add helper column:

=Date.ToText([Joining date],"MMM-yy")

nandic
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

 

If you would like to convert data from columns Jun-2020 and Jul-2020 into rows so that you could use it in report, below are steps.
In Power Query select these 2 columns and then choose unpivot columns > unpivot selected columns.
This way you will have new column which will contain values for both Jun-2020 and Jul-2020 and you will be able to compare them on the report.
Before unpivot.PNG

Before unpivot - unpivot.PNG

After unpivot.PNG

Cheers,
Nemanja

Helpful resources

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