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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
arjuna
New Member

How to pivot this data...?

I have two tables I want to create a simple relationship between (year and number).

 

One is just a Calendar() of each year 2015 through 2025:

Date,Year

4/29/2015,2015

4/30/2015,2015

 

I have a SQL summary table that looks like this:

 

2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025 <-- column names

1,0.5,2.5,3,4.5,-1,2,3.5,4,2,1,4 <-- row

 

I basically want to create a pivot'd relationship in power bi, but I'm not sure how without creating a huge mess of things. What is the minimum number of steps to accomplish this kind of link? "2015" Year in the calendar table should associate with "1" in my summary table.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@arjuna , You should unpivot this table

https://radacad.com/pivot-and-unpivot-with-power-bi

After that, if you only have a year, then create date like

Date = Date([Year],1,1)

 

Join this with date of calendar

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@arjuna , You should unpivot this table

https://radacad.com/pivot-and-unpivot-with-power-bi

After that, if you only have a year, then create date like

Date = Date([Year],1,1)

 

Join this with date of calendar

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
mahoneypat
Microsoft Employee
Microsoft Employee

You definitely should unpivot your summary table so you have a Year column that can have a relationship with your date table.  It will make your analysis and visualization much simpler/easier.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors