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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kkalyanrr
Helper V
Helper V

Amending existing table to have calendar date added as extra column

Hello ,

 

I'm trying to achieve the below result with my dataset, can you please help..

IDAmountDate ADate B
2987046551610-03-202020-02-2020
29870526206.416-04-202001-04-2020
29870627005.412-05-202023-04-2020
29870767513.501-04-202017-03-2020

 

O/P Table :

DateIDAmountDate ADate B
01-01-20202987046551610-03-202020-02-2020
01-01-202029870526206.416-04-202001-04-2020
01-01-202029870627005.412-05-202023-04-2020
01-01-202029870767513.501-04-202017-03-2020
02-01-20202987046551610-03-202020-02-2020
02-01-202029870526206.416-04-202001-04-2020
02-01-202029870627005.412-05-202023-04-2020
02-01-202029870767513.501-04-202017-03-2020
03-01-20202987046551610-03-202020-02-2020
03-01-202029870526206.416-04-202001-04-2020
03-01-202029870627005.412-05-202023-04-2020
03-01-202029870767513.501-04-202017-03-2020

 

1 REPLY 1
MFelix
Super User
Super User

Hi @kkalyanrr ,

 

If you want to delete the similar rows just delete the date row then select all columns and delete duplicates.

 

Check code below:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("nY9hCsMwCEbvkt+BfJqo21lK73+NxZUGimObhUCUL0/ztq2A2jwMRqmFnw/DmIWKkM6b0NBXOhs+mr1+IsULZWj1GaQN48z98fjG+jY2QA6WG2Tl/Qdr/mMT6lWuq+YgWwJvlm/bBjJhG9iEbWATtv22bSATtoFN2Ab2T9v9BQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, ID = _t, Amount = _t, #"Date A" = _t, #"Date B" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"ID", Int64.Type}, {"Amount", type number}, {"Date A", type date}, {"Date B", type date}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Date"}),
    #"Removed Duplicates" = Table.Distinct(#"Removed Columns")
in
    #"Removed Duplicates"

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.