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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Unpivot columns and convert to date?

So I don't see anywhere that I can attach a file so I'll have to use excel screenshots to show my example. The first screenshot below is an example excel workbook of how the data will be brought into my Power BI model. The screenshot after it is how I need the data trasformed. I know I can select all the Actual and Budget columns and then do "Unpivot Columns." I guess I am stuck on how to then create a measure to differentiate between actuals and budget amounts while also converting the "Jan 17" "Feb 17" etc to a date type field. Is it possible to take this original data source and then have measures based on "Actual" or "Budget" based on date?

 

Thanks for the help!

 

 

Before.pngAfter.png

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

After test, the solution @RolandsP posted is right. After unpivot all columns, you will get the following data.

1.PNG

Then select the [Attribute] click Split column by delimiter (Select "space" and right-most delimiter) as follows, you will get expected result.

2.PNG

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Employee
Employee

Hi @Anonymous,

After test, the solution @RolandsP posted is right. After unpivot all columns, you will get the following data.

1.PNG

Then select the [Attribute] click Split column by delimiter (Select "space" and right-most delimiter) as follows, you will get expected result.

2.PNG

Best Regards,
Angelia

RolandsP
Resolver IV
Resolver IV

You have to do following:

1) Select and unpivot all Value columns.

2) Select column that contains date and "actual" or "budget" attribute. Then do Split column by delimiter (Select "space" and right-most delimiter).

3) Then you should have 3 columns: Date, Budget/Actual and Value.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.