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.
This sounds easy, but I can't seem to figure this out.
I'm trying to change the values from dates starting with 2018 to True if there is a date or false if there isn't one.
It replaces the 2018 but leaves the trailing number still, I tried using the advanced editor but I can't seem to get it working.
Does anyone know how to do this for multi columns?
Thanks!
Solved! Go to Solution.
Hi @Anonymous,
We can create calcualted column to work on it.
Column = VAR _YEAR = YEAR ( 'Table1'[date] ) VAR _YEAR1 = YEAR ( 'Table1'[date1] ) VAR _YEAR2 = YEAR ( 'Table1'[date2] ) RETURN IF ( _YEAR = 2018 && _YEAR1 = 2018 && _YEAR2 = 2018, TRUE (), FALSE () )
For more details, please check the pbix as attached.
Regards,
Frank
Hi @Anonymous,
We can create calcualted column to work on it.
Column = VAR _YEAR = YEAR ( 'Table1'[date] ) VAR _YEAR1 = YEAR ( 'Table1'[date1] ) VAR _YEAR2 = YEAR ( 'Table1'[date2] ) RETURN IF ( _YEAR = 2018 && _YEAR1 = 2018 && _YEAR2 = 2018, TRUE (), FALSE () )
For more details, please check the pbix as attached.
Regards,
Frank
I'm still a bit novice with the query, so I took both answers, mainly creating a custom column and using if Date.Year(date)=2018 then "true" else "false".
Frank's attachment helped quit a but, as I couldn't figure out how to get to the formula part of it... I'm sure there is a better way, but for my skillset, it works.
Thanks both!
It might be a lot simpler to pivot/unpivot everything into two columns of fruit and date, then you can just make a new custom column of something like:
if Date.Year(date)=2018 then "true" else "false"
Then delete the existing date column and reverse the fruit pivoting/unpivoting
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 |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |