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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

DAX for IF formula

Need help with simple DAX formula. DAX will go in Column B. If The adjacent cell in Column A is not blank, then place a 1 in the adjacent cell in Column B. Thanks for any help!

1 ACCEPTED SOLUTION
pranit828
Community Champion
Community Champion

HI @Anonymous 

 

 

Column_B= 
IF(Table[COLUMN_A] = BLANK(), BLANK(), 1)

OR 

Column_B= 
IF(LEN(Table[COLUMN_A])=0, BLANK(), 1)

OR

Column_B= 
IF(ISBLANK(Table[COLUMN_A]), BLANK(), 1)

 

Did I resolve your issue? Mark my post as a solution!

 

Appreciate your Kudos, Press the thumbs up button!!

 

Regards,
Pranit





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

View solution in original post

8 REPLIES 8
nandukrishnavs
Super User
Super User

@Anonymous 

 

Try this DAX in the calculated column

ColumnB = IF(NOT(ISBLANK('Table'[ColumnA])),1)

nandukrishnavs_0-1597552490302.png

 


Regards,
Nandu Krishna

VijayP
Super User
Super User

@Anonymous 

assuming you are creating a new column and the name of the column you are pointing is  "SourceColumn"

=If(ISBLANK([SourceColumn]), 0,1)

Hope this Helps

Vijay Perepa

If you find this as solution please share kudos and mention this as solution.

Thanks




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


pranit828
Community Champion
Community Champion

HI @Anonymous 

 

 

Column_B= 
IF(Table[COLUMN_A] = BLANK(), BLANK(), 1)

OR 

Column_B= 
IF(LEN(Table[COLUMN_A])=0, BLANK(), 1)

OR

Column_B= 
IF(ISBLANK(Table[COLUMN_A]), BLANK(), 1)

 

Did I resolve your issue? Mark my post as a solution!

 

Appreciate your Kudos, Press the thumbs up button!!

 

Regards,
Pranit





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
Anonymous
Not applicable

Thanks this worked perfect!

lbendlin
Super User
Super User

That doesn't sound like DAX at all. Do you maybe mean Power Query? What have you tried so far?

Anonymous
Not applicable

Unfortunately I don't have permissions to do the edit in Power Query. Just trying to find a way to make the change in the data table. I just need to have a column populate 1 for every adjacent cell that is not blank. I need the "1's" to use as a count field since my table visual is not populating/counting all the data as it should.

is that computation something you only need to do once (calculated column) or can the result be impacted by filter choices (measure) ?  I guess the former?

Anonymous
Not applicable

Yeah it's just needed once.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors