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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mrfsca
Frequent Visitor

Preventing Duplicates in Column When Unpivoting Table

Hello, I'm having difficulty when trying to unpivot columns. The desired output is to have no duplicates in the "RPO Produced" column. I have read several discussions, including one from here https://community.fabric.microsoft.com/t5/Desktop/Unpivot-multiple-columns-without-duplicates/m-p/66... However, I haven't found the solution I'm looking for. Here is the attached data structure and the current result (with duplicates). How can I prevent the "RPO Produced" column from producing duplicates and show the actual value from source?
let
Source = Excel.Workbook(File.Contents("C:\\DASHBOARD.xlsx"), null, true),
Cost_Sheet = Source{[Item="Cost",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(Cost_Sheet, [PromoteAllScalars=true]),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Promoted Headers", {"Period", "Period Duration", "Location Plant", "RPO Produced (MT)"}, "Attribute", "Value")
in
#"Unpivoted Columns"
mrfsca_0-1688347994615.png

mrfsca_1-1688348006208.png

result (RPO duplicated)

mrfsca_2-1688348050013.png

 

 

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

Should should the number in the RPO producted column appear only for the depreciation cost row?  Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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