Reply
jnn4282
Helper II
Helper II
Partially syndicated - Outbound

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

Syndicated - Outbound

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

Syndicated - Outbound

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!

Syndicated - Outbound

Thanks @rbriga 

That helped me a lot.

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)