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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Replace the blank value with TEXT

I have to replace a blank value with a text.
In below visuals, Need to replace the blank value with any text say "Unknown". first column is coming from one table, and 2nd and 3rd columns are coming from another table. Both the tables are connected with a common key. I understand that, I have to create a measure to achieve this, but while writing the measure I am getting difficulty.
 

 

 
 
 

 

Replace with Unknown =
VAR _comp_code = MAX('REP EMPLOYEE_DAILY'[COMP_CD_TXT])
RETURN
IF(ISBLANK(_comp_code), "Unknown", _comp_code)
 
In the above measure calculation, instead of MAX function, which function can I use so that it can take all the values?
 
Thanks.
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Try:

Replace with Unknown =
VAR _comp_code = MAX('REP EMPLOYEE_DAILY'[COMP_CD_TXT])
RETURN
IF(_comp_code="", "Unknown", _comp_code)

 

Best Regards,
Liang
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

10 REPLIES 10
Anonymous
Not applicable

Try IF ( TEXT, TEXT1, 0 )

or

Try IF ( ISBLANK(TEXT), TEXT1, 0 )

I hope this helps

Anonymous
Not applicable

@Anonymous , this didn't help. The blank value is coming while combining both the tables. There is no blank value in the single table. I wanted to fill the blank dynamically. not in the table. 

Anonymous
Not applicable

@stevedep , how? 

Hi @Anonymous ,

 

Try:

Replace with Unknown =
VAR _comp_code = MAX('REP EMPLOYEE_DAILY'[COMP_CD_TXT])
RETURN
IF(_comp_code="", "Unknown", _comp_code)

 

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

Anonymous
Not applicable

ani24das_0-1602001610317.png

 

Hi, were you able to find the solution to this?

Hi, 

 

Did you get the solution for this blank. Please share once.

@Anonymous , You can do in a column, not in the measure  in this case

 

new COMP_CD_TXT = coalesce([COMP_CD_TXT], "Unknown")

Anonymous
Not applicable

@amitchandak , thanks for quick reply.

 

But in the table, there is no blank value exists. While joining both the tables and creating the visuals from both the tables, the blank value is coming. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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