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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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