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 have a table Projects like this
Project |
Start Date |
This has a many to one relationship with the table Milestones like this
Project |
Milestone Name |
Milestone Date |
I want to compare Start Date in the Projects table to Milestone Date in the Milestones table where Milestone Name = “Example”. If they are the same return “Same” if they are different return “Diff”
I’ve tried writing this in Dax but I just can’t figure it out – can anyone help?
Solved! Go to Solution.
Hi @DanAub ,
Please follow these steps:
(1)This is my test data :
(2) Create a measure to judgment
judgment =
VAR _time =
MAXX (
FILTER ( Milestones, Milestones[Milestone Name] = "Example" ),
Milestones[Milestone Date]
)
VAR _time2 =
MAXX (
FILTER ( Projects, Projects[Porject] = MAX ( Milestones[Project] ) ),
Projects[StarDate]
)
RETURN
IF ( _time = _time2, "Same", "Diff" )
(3) The result is as follows :
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the question.
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @DanAub ,
Please follow these steps:
(1)This is my test data :
(2) Create a measure to judgment
judgment =
VAR _time =
MAXX (
FILTER ( Milestones, Milestones[Milestone Name] = "Example" ),
Milestones[Milestone Date]
)
VAR _time2 =
MAXX (
FILTER ( Projects, Projects[Porject] = MAX ( Milestones[Project] ) ),
Projects[StarDate]
)
RETURN
IF ( _time = _time2, "Same", "Diff" )
(3) The result is as follows :
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the question.
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CalculatedColumn=IF(MINX(FILTER(RELATEDTABLE(Milestones),Milestones[Milestone Name]="Example"),Milestones[Milestone Date])=Projects[Start Date],"Same","Diff")
Measure=VAR _sd=MAX(Projects[Start Date]) RETURN IF(CALCULATE(MIN(Milestones[Milestone Date]),Milestones[Milestone Name]="Example")=_sd,"Same","Diff")
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 |
---|---|
10 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
8 |