cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
jnn4282
Helper II
Helper II

Unpivoting the data

Hi Everyone,

I need your support. I am working on a small project and the raw data is attached.

This is an online customer interaction platform. The customer register as a friend and they will get a coupon on various occasions.

Such as answering the survey, and giving their personal behaviors.

The data is based on conversation and all coupons are scattered. 

My desire is simply to have a header ID, Coupon1, Coupon2, and so on. Rows with their ID, and Give or Used for their respective coupon.

IDCoupon 1Coupon 2

1

GivenGiven
1Used 

https://we.tl/t-herr6gllDU 

I tried grouping and unpivoting but ID is repeatedly shown.

Thanks

1 ACCEPTED SOLUTION
rbriga
Impactful Individual
Impactful Individual

1. Right click the table, then "edit query" to open the Query Editor

2. Highlet USERID and Conversation Count, then Transform->Unpivot Columns-> Unpivot other columns (see screenshot)

3. Rename "Attribute" as "Status"

4. Create a conditional column as seen here for "used"

5. You can add a "given" column the same wayUnpivot 1.pngConditional 1.png

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

View solution in original post

2 REPLIES 2
rbriga
Impactful Individual
Impactful Individual

1. Right click the table, then "edit query" to open the Query Editor

2. Highlet USERID and Conversation Count, then Transform->Unpivot Columns-> Unpivot other columns (see screenshot)

3. Rename "Attribute" as "Status"

4. Create a conditional column as seen here for "used"

5. You can add a "given" column the same wayUnpivot 1.pngConditional 1.png

 

-------------------------
Data analyst by day, hockey goalie by night.
Did I help? Then please hit that "kudos" or "accept as a solution" button!

Thanks @rbriga 

That helped me a lot.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors