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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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