The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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?
Solved! Go to Solution.
@Anonymous , Try a new column like
if(isblank([date]),"On Hire","Off Hired")
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!
Column = IF(ISBLANK([Off Hire]),BLANK(),"Off HIred")