Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi All,
| Platform | Date1 | Date2 |
| Apple | 12/01/21 | 23/08/21 |
| Sony | 12/11/21 | 19/03/21 |
| Apple | 09/10/21 | 12/12/20 |
| Microsoft | 09/08/20 | 08/05/22 |
I am trying to create a simple custom column in Power BI but unfortuately I keep running into errors.
What I want to do is if the Platform is "Sony" or "Apple" populate Date1, otherwise populate Date2.
What I'm currently using is, but this isn't working
CustomerColumn = if 'Data'[Data.Platform]= "Sony" then 'Data'[Data.Date1] else if 'Data'[Data.Platform]= "Apple" then 'Data'[Data.Date1] else 'Data'[Data.Date2]
Solved! Go to Solution.
@obriaincian , The above is Power Query. In DAX you can try like
CustomerColumn = Switch( True() ,
'Data'[Data.Platform]= "Sony" , 'Data'[Data.Date1] ,
'Data'[Data.Platform]= "Apple" , 'Data'[Data.Date1] ,
'Data'[Data.Date2])
@obriaincian , The above is Power Query. In DAX you can try like
CustomerColumn = Switch( True() ,
'Data'[Data.Platform]= "Sony" , 'Data'[Data.Date1] ,
'Data'[Data.Platform]= "Apple" , 'Data'[Data.Date1] ,
'Data'[Data.Date2])
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 37 | |
| 31 | |
| 30 |