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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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