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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
PBINewbie920
Helper I
Helper I

Create a Master Date column

Hi! 

 

So my data currently looks like this: 

 

Project #Booked Date Billed Date$ Amount
111/1/2021 $10
211/2/202112/4/2021$13
311/5/202112/1/2021$5

 

This is how i want it to look (basicially just one "date" column instead of 2 & new columns for bookings and billings)

 

Project #DateBookings $Billings $
111/1/2021$10 
211/2/2021$13 
212/4/2021 $13
311/5/2021$5 
312/1/2021 $5

 

Any ideas on how  I can create this? 

 

Thanks!!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@PBINewbie920 ,

1. Unpivot Booked Date, Billed Date

2. replace - In New Attribute column , Replace Date -> $

3. Pivot -> Amount based on Attribute

 

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI01DfUNzIwArEVgFjF0EApVidayQgiZwSTMzTSN4GxVQyNwWqMIWpMkdTAzVIxVYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Project #" = _t, #"Booked Date" = _t, #" Billed Date" = _t, #"$ Amount" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project #", Int64.Type}, {"Booked Date", type date}, {" Billed Date", type date}, {"$ Amount", Currency.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Project #", "$ Amount"}, "Attribute", "Value"),
    #"Replaced Value" = Table.ReplaceValue(#"Unpivoted Columns","Date","$",Replacer.ReplaceText,{"Attribute"}),
    #"Pivoted Column" = Table.Pivot(#"Replaced Value", List.Distinct(#"Replaced Value"[Attribute]), "Attribute", "$ Amount", List.Sum)
in
    #"Pivoted Column"

 

 

 

https://radacad.com/pivot-and-unpivot-with-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@PBINewbie920 ,

1. Unpivot Booked Date, Billed Date

2. replace - In New Attribute column , Replace Date -> $

3. Pivot -> Amount based on Attribute

 

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI01DfUNzIwArEVgFjF0EApVidayQgiZwSTMzTSN4GxVQyNwWqMIWpMkdTAzVIxVYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Project #" = _t, #"Booked Date" = _t, #" Billed Date" = _t, #"$ Amount" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Project #", Int64.Type}, {"Booked Date", type date}, {" Billed Date", type date}, {"$ Amount", Currency.Type}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Project #", "$ Amount"}, "Attribute", "Value"),
    #"Replaced Value" = Table.ReplaceValue(#"Unpivoted Columns","Date","$",Replacer.ReplaceText,{"Attribute"}),
    #"Pivoted Column" = Table.Pivot(#"Replaced Value", List.Distinct(#"Replaced Value"[Attribute]), "Attribute", "$ Amount", List.Sum)
in
    #"Pivoted Column"

 

 

 

https://radacad.com/pivot-and-unpivot-with-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.