Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
peterso
Helper II
Helper II

This should be simple, right?

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.

 

Capture.PNG

 

The result should look like this:

ccccc.PNG

 

Thank you in advance!

 

4 REPLIES 4
harshnathani
Community Champion
Community Champion

Hi @peterso ,

 

Use the Add Conditional Column Feature

 

1.jpg

 

 

 

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)

amitchandak
Super User
Super User

@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)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

[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.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.