Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Project Number | Date | Version Number |
1234 | Version_1 | |
12345 | 01/01/2021 | Version_1 |
1234 | Version_1 | |
1234 | 20/11/2022 | Version_2 |
1234 | 20/11/2022 | Version_2 |
1234 | 20/11/2022 | Version_2 |
1234 | Version_1 | |
1234 | 21/11/2022 | Version_3 |
1234 | 21/11/2022 | Version_5 |
12345 | 21/11/2022 | Version_2 |
1234 | 21/11/2022 | Version_4 |
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
11 | |
7 | |
6 | |
6 |