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! It's time to submit your entry. Live 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.
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 35 | |
| 24 | |
| 22 |
| User | Count |
|---|---|
| 134 | |
| 107 | |
| 57 | |
| 43 | |
| 38 |