Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.