The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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))))
User | Count |
---|---|
71 | |
63 | |
62 | |
50 | |
28 |
User | Count |
---|---|
117 | |
75 | |
62 | |
54 | |
43 |