Forum Discussion
I'm stumped!
Hi all,
I'm stumped on what should be a simple exercise, and my attempts have not been successful. Hopefully you folks can help.
I've tried variations of IF statements and Lookups and have had no luck.
My goal is to return the value of Column B into Column C if the value in Column A equals to 1/10/2020, otherwise return 0.
The result should look like this:
Thank you in advance!
- Anonymous6 years ago
Hi peterso ,
Try using Add Column --> Conditional Column
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
7 Replies
- lbendlin
Super User
Where do you want to do that, in Power Query or in DAX?
- AnonymousNot applicable
Hi peterso
I would create a new column as below
Column C = IF('Table'[Column A]=DATE(2020,1,10),'Table'[Column B],"0")See below the screen shot for a sample example. Here the date is 02/01/2019(MM/DD/YYYY)
- amitchandak
Super User
peterso ,
M
Column C = if [Column A] =Date.FromText("2020-01-01") then [Column B] else 0
Dax
Column C = Switch( True() , [Column A] =Date(2020,1,1) , [Column B], 0)