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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Betigolo
Helper I
Helper I

Matrix to Table help

Hi,

 

I need your help.

 

How to transform the following table:

 

Name  |  Course1 | Course 2 | Course 3|

A         |  YES        |    YES       | NO         |

B         |   NO        |    NO       |  YES       |

C         |   NO        |     YES     |   NO       |

 

In to :

 

Name   |  Course     | mandatory

A          |   Course1  |    YES

A          |   Course2  |    YES

A          |  Course 3  |    NO

B          |  Course 1  |    NO

B          |  Course 2  |    NO 

B          |   Course 3 |    YES

         |   Course 1 |    NO

C          |   Course2  |    YES

C          |  Course 3  |    NO

 

Or

 

Name   |  Course     | mandatory

A          |   Course1  |      YES

A          |   Course2  |     YES

 

B          |   Course 3 |      YES

C          |   Course2  |     YES

 

 

Or

Name   |  Course     | 

A          |   Course1  |      

A          |   Course2  |     

B          |   Course 3 |      

C          |   Course2  |     

 

Many thanks for your help

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @Betigolo,

 

In your scenario, you should be able to use the Unpivot Column option in Query Editor to unpivot the Course columns to get your expected result. For more details about how to Pivot and Unpivot with Power BI, you can refer to this article. Smiley Happy

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @Betigolo,

 

In your scenario, you should be able to use the Unpivot Column option in Query Editor to unpivot the Course columns to get your expected result. For more details about how to Pivot and Unpivot with Power BI, you can refer to this article. Smiley Happy

 

Regards

Many thanks..... so easy and clear. Awesome

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.