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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
bobceres
Regular Visitor

IF THEN ELSE

I am familiar with IF THEN ELSE statements in excel, but not sure how it translates to DAX.  Essentially I have a column with several 6 digits numbers, but some of the values in that column are blank.  I want build a new custom column with an IF THEN ELSE statement that states IF that column is blank, to use the values of another column. IF it is not blank, it keeps the current value.

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @bobceres 

According to your description, I can roughly understand your requirement, I think you can create a calculated column like this to achieve your requirement:

This is my test data:

vrobertqmsft_0-1635845267037.png

Expected ID =

IF(ISBLANK([ID1]),[ID2],[ID1])

 

And you can get what you want, like this:

vrobertqmsft_1-1635845267044.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @bobceres 

According to your description, I can roughly understand your requirement, I think you can create a calculated column like this to achieve your requirement:

This is my test data:

vrobertqmsft_0-1635845267037.png

Expected ID =

IF(ISBLANK([ID1]),[ID2],[ID1])

 

And you can get what you want, like this:

vrobertqmsft_1-1635845267044.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VahidDM
Super User
Super User

Hi @bobceres 

 

You need to use IF and ISBLANK dax functions:

something like this:

 

If(isblank([column1]),[column2],[column1])

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!



 

mahoneypat
Microsoft Employee
Microsoft Employee

If the blank values are showing as null, you can use this expression.  If they don't, you can use = "" instead.

 

= if [columnwithvalue] = null then [othercolumn] else [columnwithvalue]

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.