The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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!
Hi @peterso ,
Use the Add Conditional Column Feature
if [ColumnA] = #date(2020, 1, 10) then [ColumnB] else 0
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
@peterso , Try a new column
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)
[Column C] = // calculated column
if(
// Column A in T must, of course,
// be of type date.
T[Column A] = date(2020, 10, 1),
T[Column B],
0
)
Tried this the first time and tried this again. It didn't work. Returns all 0s in the column.