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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 33 | |
| 29 | |
| 26 |
| User | Count |
|---|---|
| 135 | |
| 103 | |
| 65 | |
| 61 | |
| 55 |