Forum Discussion

peterso's avatar
peterso
Icon for Helper II rankHelper II
6 years ago
Solved

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!

 

  • Anonymous's avatar
    Anonymous
    6 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

  • Anonymous's avatar
    Anonymous
    Not 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)

     

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

    • peterso's avatar
      peterso
      Icon for Helper II rankHelper II

      amitchandak 

       

      Looks like I got an error but everything should be correct. What do you think?

      • Anonymous's avatar
        Anonymous
        Not applicable

        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)