cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shishir999 Regular Visitor
Regular Visitor

Data duplicacy while UnPivotting data

Hi,

 

I am trying to Unpivot data, but getting Duplicate data while data modelling in PBI.

The 1st table is Soure and the 2nd one is my expected.

 

Please see the screenshot:

myReq-01.JPG

 

Thank

Shishir Goel

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Data duplicacy while UnPivotting data

Hi @shishir999 ,

1. You could upivot the columns Act_Jan,Est_Jan,Diff_Jan,...,Act_Mar,Est_Mar,Diff_Mar in Query Editor.

unpivot columns.png

2. Add conditional columns(optional). If you create this column, you could get your desired output like that in your image. If you don't create this custom column, you will get the output like this.

without sort by column.PNG

3. If you create the conditional column in Query Editor, you need sort by column under Data view.

sort by column.png

4. Then you could create your desired matrix.

Matrix.PNG

For more details about how to create the conditional column, you could refer to my attachment.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Data duplicacy while UnPivotting data

Hi @shishir999 ,

By my tests, based on your data sample, you could achieve your desired output with Matrix visual in Power BI like below.

matrix.PNG

If you still need help, feel free to ask.

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
shishir999 Regular Visitor
Regular Visitor

Re: Data duplicacy while UnPivotting data

Thanks Cherry, I tried implementing the same earlier.

 

As in Value, I need to add multiple fields. So, my requirement is to Unpivot the data from source using data modelling, followed by rest of the calculations and use less no. of fields.

 

Please advise.

 

Regards

Shishir

Community Support Team
Community Support Team

Re: Data duplicacy while UnPivotting data

Hi @shishir999 ,

1. You could upivot the columns Act_Jan,Est_Jan,Diff_Jan,...,Act_Mar,Est_Mar,Diff_Mar in Query Editor.

unpivot columns.png

2. Add conditional columns(optional). If you create this column, you could get your desired output like that in your image. If you don't create this custom column, you will get the output like this.

without sort by column.PNG

3. If you create the conditional column in Query Editor, you need sort by column under Data view.

sort by column.png

4. Then you could create your desired matrix.

Matrix.PNG

For more details about how to create the conditional column, you could refer to my attachment.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
shishir999 Regular Visitor
Regular Visitor

Re: Data duplicacy while UnPivotting data

Bingo....Thanks Cherry.

 

I was able to do the transformation i.e. in Step-2, but the Conditional column makes the magic.

Appreciated your help.

 

Regards

Shishir

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors