Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
Hi all,
I have a 'Customer' Table:
ID | Date1 | Date2 |
1 | 1/1/2021 | |
2 | 1/2/2021 | |
3 | 1/3/2021 | |
4 | 1/4/2021 | |
5 | 1/5/2021 | 1/5/2021 |
I need a dax that unit the column Date 1 with Date 2 just if Date2 is empty.
For example:
ID | Date1 | Date2 | NewColumn |
1 | 1/1/2021 | 1/1/2021 | |
2 | 1/2/2021 | 1/2/2021 | |
3 | 1/3/2021 | 1/3/2021 | |
4 | 1/4/2021 | 1/4/2021 | |
5 | 1/5/2021 | 1/5/2021 | 1/5/2021 |
Thanks All.
Solved! Go to Solution.
If they're both from the same table, then there shouldn't be any problem writing a calculated column on that same table as I suggested and I don't know why you say you can't find them.
Of course, if you're defining a measure, then you need to use an aggregation function since there isn't any row context like there is in a calculated column. For example,
Measure1 = COALESCE ( MAX ( Customer[Date1] ), MAX ( Customer[Date2] ) )
With COALESCE function I can't find the columns 'Date1' and 'Date2' in my table.
Do you know why? @AlexisOlson
Thank you!
I was assuming that those were your columns on your table and suggesting how to define a new calculated column. If they aren't in your table, then you'll need to explain where they are since you haven't shared your file.
I took the columns from two different tables but I created one table with all these columns in power query (after merging between tables).
I don't follow.
Replace the column references I gave with whatever column or value they should be. If they're measures, then remove both 'Customer' table references from what I gave and it should work as a measure. If they aren't columns from the same table or measures, then you need to provide more information.
This is two columns from the same table, tell me which information do you need please.
Thank you!
If they're both from the same table, then there shouldn't be any problem writing a calculated column on that same table as I suggested and I don't know why you say you can't find them.
Of course, if you're defining a measure, then you need to use an aggregation function since there isn't any row context like there is in a calculated column. For example,
Measure1 = COALESCE ( MAX ( Customer[Date1] ), MAX ( Customer[Date2] ) )
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
16 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |