Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
How to combine two dates columns of a table into one new column .please check below sample data for reference.
expecting output:
Sample excelreport:
In_Date | Out_date |
01-11-2014 | 20-08-1999 |
15-04-1998 | 19-01-1998 |
16-11-2022 | |
20-08-1999 | 21-08-1999 |
21-01-2001 | 20-09-1993 |
21-09-1994 | 21-01-2001 |
30-01-1997 | 01-11-2014 |
Thanks,
Pioneer
Solved! Go to Solution.
Hi, @Pioneer
This can only be done in Power Query.
Copy two more tables, delete one of the columns from each table, change the column names to [In and Out date] and use Append.
Select Remove duplicates.
Join the initial table and the Append table to the right.
Result:
Click in the top right corner to expand.
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Pioneer
You can try the following methods.
New Table:
Table 2 = DISTINCT(UNION(VALUES('Table'[In_Date]),VALUES('Table'[Out_date])))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-zhangti ,
Thanks for reply , My requirement is to create another column in the same table instead of creating new table.
that New column should able to use in slicer visual aswell.
Thanks,
Pioneer
Hi, @Pioneer
This can only be done in Power Query.
Copy two more tables, delete one of the columns from each table, change the column names to [In and Out date] and use Append.
Select Remove duplicates.
Join the initial table and the Append table to the right.
Result:
Click in the top right corner to expand.
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have 9 date columns . Can you help plz?i tried the above solution but no luck. Is there anyway i can define date filter combining all the 9 date columns? Attached sample data. Kindly help.
Task# | User | Task Name | Planned Start | Planned End | Actual Start | Actual End | IT Approval | Initial Approval | Technical Approval | Final Approval | Status |
1 | John | Task 1 | 10/2/2023 0:00 | 10/8/2023 0:00 | 10/2/2023 0:00 | 10/8/2023 0:00 | 12/26/2023 0:00 | 11/4/2023 0:00 | 12/13/2023 0:00 | In Progress | |
2 | Johnny | Task2 | 9/12/2023 0:00 | 9/27/2023 0:00 | 9/12/2023 0:00 | 12/2/2023 0:00 | On-hold | ||||
3 | Claire | Task3 | On-hold | ||||||||
4 | Venna | Task4 | 12/3/2023 0:00 | 12/3/2023 0:00 | 12/13/2023 0:00 | In Progress | |||||
5 | Sierra | Task5 | 9/30/2023 0:00 | 10/4/2023 0:00 | 1/20/2024 | Canceled | |||||
6 | Adam | Task6 | 1/1/2024 | Completed | |||||||
7 | John | Task7 | 9/24/2023 0:00 | 9/25/2023 0:00 | 9/25/2023 0:00 | 9/25/2023 0:00 | Completed | ||||
8 | Johnny | Task8 | 11/6/2023 0:00 | 11/8/2023 0:00 | 11/6/2023 0:00 | 11/11/2023 0:00 | 11/12/2023 0:00 | 11/19/2023 0:00 | Completed | ||
9 | Claire | Task9 | 9/9/2023 0:00 | 9/11/2023 0:00 | 9/9/2023 0:00 | 9/11/2023 0:00 | 10/1/2024 0:00 | 15/1/2024 12:00:00 AM | Completed | ||
10 | Venna | Task10 | 12/23/2023 0:00 | 1/3/2024 0:00 | 12/23/2023 0:00 | 1/3/2024 0:00 | 1/14/2024 0:00 | 1/7/2024 0:00 | 1/17/2024 0:00 | Completed |
Hi @Luis98,
Iam looking for the Dax logic to achieve the expected output column in the same table.
Thanks,
Pioneer
Yes, but its needed to know the logic how you want obtain the output column,
is In_date at top and Out_date at bottom and remove duplicates?
We need to get all the dates, including blank values if existed from both the columns in one new column and need to maintain unique data.
Thanks
pioneer
I think the best is do it in Power Query. You can duplicate the table and then append, and you will have something like this:
And you just should to combine both columns and remove duplicates.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
33 | |
16 | |
13 | |
10 | |
8 |
User | Count |
---|---|
59 | |
20 | |
12 | |
11 | |
10 |