March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I have table such as below:
Start Date | Date 1 | Date 2 | Date 3 | Date 4 | Date 5 | (DAX new column) Earliest Date |
1/1/20 | 1/3/23 | 1/3/23 | 1/3/23 | |||
5/5/20 | 9/9/23 | 5/20/24 | 9/9/23 |
with many more rows.
Please note (DAX new column) Earliest Date only looks at Date 1 - Date 5 columns (Start Date don't count).
How can I return the column name (Date 1 - Date 5), that contains value in (DAX new column) Earliest Date?
Please note some may return multiple column name.
Goal:
Start Date | Date 1 | Date 2 | Date 3 | Date 4 | Date 5 | (DAX new column) Earliest Date | (DAX new column) Earliest Date Column |
1/1/20 | 1/3/23 | 1/3/23 | 1/3/23 | Date 3, Date 4 | |||
5/5/20 | 9/9/23 | 5/20/24 | 9/9/23 | Date 2 |
Thank you so much!
Solved! Go to Solution.
Hi,
I am not sure when you are getting this error, however I have added a row with all the Date 1 - Date 5 as blank and modified the 2nd measure a little to show the value:
If this resolves your problem, then please accept this as solution, Thanks!
Hi,
considering you have 5 columns to compare, you can create below mentioned measures to achieve your goal.
First measure to find min date:
If this resolves your problem, then please accept this as solution, Thanks!
Thank you so much for writing everything out! May I ask if you know how to fix the error "A table of multiple values was supplied where a single value was expected." please? I do have a few rows where there is no date listed in any columns.
Hi,
I am not sure when you are getting this error, however I have added a row with all the Date 1 - Date 5 as blank and modified the 2nd measure a little to show the value:
If this resolves your problem, then please accept this as solution, Thanks!
Hello, thank you for the update! I did a few treaks on your DAX and it came out beautifully! much appreciated samratpbi!
You need to unpivot your data to bring it into a usable format. After that the measures will write themselves.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |