cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
kelly008
Helper I
Helper I

Replacing (BLANK) field with Text

Hello,

 

I am currently trying to replace a (blank) field with the text "Machine Check not Carried Out". The column itself is also in text format.

 

However, I can't seem to find the correct measure:

 

MKMachineBlank = IF( 'MaintenanceRequired2' = 0, "Machine Check Not Carried Out", 'MaintenanceRequired2') 
 
I'm currently using the above, but it appears that this measure is for replacing a number field that is displaying a (blank) as apposed to my situation where I want to replace a text field (blank) with text.
 
Any help would be much appreciated.
Thanks.
1 ACCEPTED SOLUTION

Hi, @kelly008 
Try this

MKMachineBlank = 
var CurrentItem = SELECTEDVALUE('Preventative Maintenance Log'[MaintenanceRequired2])
return IF( ISBLANK(CurrentItem )||CurrentItem = "", "Machine Check Not Carried Out",  CurrentItem)
 

View solution in original post

6 REPLIES 6
Pragati11
Super User
Super User

HI @kelly008 ,

 

What is the datatype of the column MaintenanceRequired2 in your table?

Is MaintenanceRequired2 a column in your table or measure?

 

If it is a column and is of text datatype, then use the following DAX expression:

MKMachineBlank =
IF (
    ISBLANK ( yourTable[MaintenanceRequired2] ) = TRUE(),
    "Machine Check Not Carried Out",
    yourTable[MaintenanceRequired2]
)

In the above DAX expression just replace yourTable with the table name you have at your end.

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi, thanks for replying.

 

I'm getting this error after using the measure you suggested:

kelly008_3-1660230380410.png

I'm guessing this is becuase I didnt share the table name? Please see below:

kelly008_4-1660230414026.png

 

Again, thank you for replying.

vojtechsima
Memorable Member
Memorable Member

Hi, @kelly008 
try this:

MKMachineBlank = IF( ISBLANK('MaintenanceRequired2') || 'MaintenanceRequired2' = "", "Machine Check Not Carried Out", 'MaintenanceRequired2') 
 

Hi, thanks for replying, sorry I may not have included all of the relavent information. 

 

I'm currently getting this error after using the measure you suggested:

kelly008_1-1660230159275.png

 

 

I'm guessing this is becuase I didnt include the table that the column is coming from? This is the table alongside the column and the measure you suggested:

kelly008_2-1660230218112.png

Again, thank you for replying.

Hi, @kelly008 
Try this

MKMachineBlank = 
var CurrentItem = SELECTEDVALUE('Preventative Maintenance Log'[MaintenanceRequired2])
return IF( ISBLANK(CurrentItem )||CurrentItem = "", "Machine Check Not Carried Out",  CurrentItem)
 

Thats it! Thank you!

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors