Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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])
User | Count |
---|---|
93 | |
83 | |
77 | |
71 | |
65 |
User | Count |
---|---|
114 | |
101 | |
96 | |
65 | |
60 |