Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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])
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 62 | |
| 51 | |
| 45 |