Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello
I am trying to create a DAX formula that creates a new collumn that for any duplicate set of ID numbers identifes with 'Yes' the row that has the earliest date and a 'no' for all the others. Example of end result I am after is:
ID | Date | *New Collumn* |
A | 01/01/2024 | Yes |
A | 02/01/2024 | No |
B | 01/01/2023 | Yes |
B | 02/01/2023 | No |
C | 01/01/2024 | Yes |
I appreciate any help!
Thanks
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Expected result CC =
VAR _earliest =
MINX (
INDEX (
1,
SUMMARIZE(Data, Data[ID], Data[Date]),
ORDERBY ( Data[Date], ASC ),
,
PARTITIONBY ( Data[ID] ),
MATCHBY ( Data[ID], Data[Date] )
),
Data[Date]
)
RETURN
IF ( Data[Date] = _earliest, "Yes", "No" )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
Please check the below picture and the attached pbix file.
INDEX function (DAX) - DAX | Microsoft Learn
Expected result CC =
VAR _earliest =
MINX (
INDEX (
1,
Data,
ORDERBY ( Data[Date], ASC ),
,
PARTITIONBY ( Data[ID] ),
MATCHBY ( Data[ID], Data[Date] )
),
Data[Date]
)
RETURN
IF ( Data[Date] = _earliest, "Yes", "No" )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
ID | Date | Expected result CC |
A | 1/1/24 | Yes |
A | 1/1/24 | Yes |
A | 1/1/25 | No |
B | 1/2/23 | Yes |
B | 1/2/24 | No |
C | 1/1/24 | Yes |
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Expected result CC =
VAR _earliest =
MINX (
INDEX (
1,
SUMMARIZE(Data, Data[ID], Data[Date]),
ORDERBY ( Data[Date], ASC ),
,
PARTITIONBY ( Data[ID] ),
MATCHBY ( Data[ID], Data[Date] )
),
Data[Date]
)
RETURN
IF ( Data[Date] = _earliest, "Yes", "No" )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Perfect! thank you very much
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
10 | |
10 | |
9 |
User | Count |
---|---|
15 | |
13 | |
12 | |
11 | |
10 |