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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Replace blank/Empty cell with P0 in result column

Hi Experts

 

Need to amend the following calculated column measure to ignore where we have a empty cell in Uploaded column in the table

Period =
VAR p=find("P",'Table'[Uploaded],1)
return MID('Table'[Uploaded],p+1,100)*1
 
Currently this is returning an error when the first rows are blank..and replace where we have blank in uploaded column with P0 in new column.
1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@Anonymous 

One way to handle this is to use an IF statement to check for blank cells.  Try something like:

Period =
VAR p=IF ( ISBLANK[Uploaded]=TRUE(), 0, find("P",'Table'[Uploaded],1))
return 
IF(ISBLANK[Uploaded]=TRUE(),"P0", MID('Table'[Uploaded],p+1,100)*1

I am not perfect at writing syntax on the fly, so some adjustments might be necessary.  But I hope this points you in the right direction.

Good Luck and Regards,

View solution in original post

2 REPLIES 2
SwathiKundar
Frequent Visitor

Try this

 

 

Period =
VAR p=find("P",'Table'[Uploaded],1)
return If('Table'[Uploaded]<>blank(), MID('Table'[Uploaded],p+1,100)*1))

rsbin
Super User
Super User

@Anonymous 

One way to handle this is to use an IF statement to check for blank cells.  Try something like:

Period =
VAR p=IF ( ISBLANK[Uploaded]=TRUE(), 0, find("P",'Table'[Uploaded],1))
return 
IF(ISBLANK[Uploaded]=TRUE(),"P0", MID('Table'[Uploaded],p+1,100)*1

I am not perfect at writing syntax on the fly, so some adjustments might be necessary.  But I hope this points you in the right direction.

Good Luck and Regards,

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.