Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi ,
i have a source file (CSV) and i need matching data with all columns based on condition Day Date = Week End date usingPower Queryand data screeenshot is below..
Code in power query editor
let
//I. GET DYNAMIC PATH
SourceRPT= PRM_SOURCES{[NAME="DIR XML"]}[PRM],
//2. CSV, adjust Delimiter type and Columns accordingly
Source = Csv.Document(File.Contents(SourceRPT),[Delimiter=",", Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"
Could you please help me with code i need to use.
Regards,
Bhaskar
Solved! Go to Solution.
You can add a custom column to flag rows where the Day Date matches the Week End date.
#"Added Custom" = Table.AddColumn(#"Promoted Headers", "Match", each if [Day Date] = [Week End Date] then "Match" else "No Match")
Your final code in the Power Query Editor will look something like this:
let //I. GET DYNAMIC PATH SourceRPT= PRM_SOURCES{[NAME="DIR XML"]}[PRM], //2. CSV, adjust Delimiter type and Columns accordingly Source = Csv.Document(File.Contents(SourceRPT),[Delimiter=",", Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.None]), #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]), #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Match", each if [Day Date] = [Week End Date] then "Match" else "No Match"), in #"Added Custom"
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can add a custom column to flag rows where the Day Date matches the Week End date.
#"Added Custom" = Table.AddColumn(#"Promoted Headers", "Match", each if [Day Date] = [Week End Date] then "Match" else "No Match")
Your final code in the Power Query Editor will look something like this:
let //I. GET DYNAMIC PATH SourceRPT= PRM_SOURCES{[NAME="DIR XML"]}[PRM], //2. CSV, adjust Delimiter type and Columns accordingly Source = Csv.Document(File.Contents(SourceRPT),[Delimiter=",", Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.None]), #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]), #"Added Custom" = Table.AddColumn(#"Promoted Headers", "Match", each if [Day Date] = [Week End Date] then "Match" else "No Match"), in #"Added Custom"
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Jayleny,
I am accepting solution and Kudos to you. Thanks for your support.
Regards,
Bhaskar
User | Count |
---|---|
104 | |
92 | |
88 | |
78 | |
71 |
User | Count |
---|---|
113 | |
105 | |
101 | |
75 | |
64 |