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.
Hi all,
I'm struggling turning this formula in Exel to Power BI
=IF(Date2<>"-",YEAR(Date2),IF(Date3<>"-",YEAR(Date3),IF(Date4<>"-",YEAR(Date4),IF(Date1<>"-",YEAR(Date1),2020))))
The yellow column is what I want.
Can someone please help?
Thank you
Solved! Go to Solution.
If this is a calculated column, then it should be:
=IF([Date2]<>"-",YEAR([Date2]),IF([Date3]<>"-",YEAR([Date3]),IF([Date4]<>"-",YEAR([Date4]),IF([Date1]<>"-",YEAR([Date1]),2020))))
@Greg_DecklerThank you Greg. The solution you posted it work but I slighly edited the function. Because the column is a date type it cannot be text "-" so I replaced with BLANK().
Column =IF([Date2]<>BLANK(),YEAR([Date2]),
IF([Date3]<>BLANK(),YEAR([Date3]),
IF([Date4]<>BLANK(),YEAR([Date4]),
IF([Date1]<>BLANK(),YEAR([Date1]),2020))))
If this is a calculated column, then it should be:
=IF([Date2]<>"-",YEAR([Date2]),IF([Date3]<>"-",YEAR([Date3]),IF([Date4]<>"-",YEAR([Date4]),IF([Date1]<>"-",YEAR([Date1]),2020))))
@Greg_DecklerThank you Greg. The solution you posted it work but I slighly edited the function. Because the column is a date type it cannot be text "-" so I replaced with BLANK().
Column =IF([Date2]<>BLANK(),YEAR([Date2]),
IF([Date3]<>BLANK(),YEAR([Date3]),
IF([Date4]<>BLANK(),YEAR([Date4]),
IF([Date1]<>BLANK(),YEAR([Date1]),2020))))
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |