Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I need to generate a column in Maintenance that equals 1 if:
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |