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
Anonymous
Not applicable

Changing field values in new calculated column

Hi All,

 

I currently have a data set which has an Off Hire column, this field is either blank or has an Off Hire data. I want to create a new calculated column which will show a text field stating "Off Hired" when a date is there and "On Hire" for when there is a blank cell.

 

I have tried a switch formula but can't seem to get the hang of it, can anyone help me with this?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a new column like

if(isblank([date]),"On Hire","Off Hired")

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

View solution in original post

4 REPLIES 4
dedelman_clng
Community Champion
Community Champion

Hi @Anonymous ,

 

Often if you have a situation where you only want one of two outcomes, and one of the conditions involves blank/empty string/null, you test for the existence of data in the field you want, and then if the data doesn't exist it uses the result for blank. Working with BLANK() inside of DAX can be tricky.

 

Status = IF( NOT( ISBLANK ( Table[OffHire] ) ), "Off Hire", "On Hire") 

 

If this does not work, please provide sample data or a sample .pbix

 

Hope this helps

David

It's really not necessary to create this in DAX, use Power Query instead!

amitchandak
Super User
Super User

@Anonymous , Try a new column like

if(isblank([date]),"On Hire","Off Hired")

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
Greg_Deckler
Community Champion
Community Champion

Column = IF(ISBLANK([Off Hire]),BLANK(),"Off HIred")



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors