Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
11 | |
11 | |
10 | |
6 |