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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
vishal140197
Frequent Visitor

Power Query Updating a row

I am trying to do this in Power BI. Whether DAX or Power Query anything would be useful.

I have 2 columns one is 'Date' and the other is 'Version Number'.

I want to update the dates where 'Version Number' is Version_1 and 'Date' is blank to the dates where 'Version Number' is Version_2 and 'Date' is not blank.

Basically if Version_2 has a date and Version_1 doesn't have a date then the dates of these Version_2 should be copied to Version_1 dates.

Tried nested ifs in power query and DAX but not able to achieve the desired result.

3 REPLIES 3
ChiragGarg2512
Solution Sage
Solution Sage

@vishal140197 share a sample data in tabular form.

Project NumberDateVersion Number
1234 Version_1
1234501/01/2021Version_1
1234 Version_1
123420/11/2022Version_2
123420/11/2022Version_2
123420/11/2022Version_2
1234 Version_1
123421/11/2022Version_3
123421/11/2022Version_5
1234521/11/2022Version_2
123421/11/2022Version_4
   

@vishal140197 

let
    Source = your_table,
    fx_v2_date = (tbl as table) as table =>
        [v2_date = Table.SelectRows(tbl, each [Version Number] = "Version_2"){0}[Date]?,
        v1_change = 
            Table.ReplaceValue(
                tbl, each [Version Number], v2_date, 
                (v, o, n) => 
                    if v = null and o = "Version_1" 
                    then n else v, {"Date"}
            )][v1_change],
    group = 
        Table.Group(
            Source, {"Project Number"}, 
            {{"all", fx_v2_date}}
        ),
    expand = Table.ExpandTableColumn(group, "all", {"Date", "Version Number"})
in
    expand

 

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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