Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I need to generate a column in Maintenance that equals 1 if:
@Anonymous
Solved! Go to Solution.
Hi @Jan-H
Car Table
Add a Year column in Matintenance Table.
Year = YEAR(Maintenance[Date of Maintenance])
Then try this code.
Flag 1 =
VAR _MinDateEachYear =
CALCULATE (
MIN ( Maintenance[Date of Maintenance] ),
FILTER ( Maintenance, Maintenance[Year] = EARLIER ( Maintenance[Year] ) )
)
RETURN
IF (
AND (
RELATED ( Car[Registration year] ) = 2010,
Maintenance[Date of Maintenance] = _MinDateEachYear
),
1,
BLANK ()
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Jan-H
Car Table
Add a Year column in Matintenance Table.
Year = YEAR(Maintenance[Date of Maintenance])
Then try this code.
Flag 1 =
VAR _MinDateEachYear =
CALCULATE (
MIN ( Maintenance[Date of Maintenance] ),
FILTER ( Maintenance, Maintenance[Year] = EARLIER ( Maintenance[Year] ) )
)
RETURN
IF (
AND (
RELATED ( Car[Registration year] ) = 2010,
Maintenance[Date of Maintenance] = _MinDateEachYear
),
1,
BLANK ()
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.