cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MossyD
Regular Visitor

DAX New Column and Substitute

Hi All
I am trying to understand how to create a new column from one table to within another table and replace any blanks within the new column with "No Record" text.

The following does not replace the Blanks with text. But, I am unsure how to structure my code...

UPN = SUBSTITUTE(RELATED(users[userPrincipalName]), "", "No Record")

Could anyone please help me to understand?

Many thanks

1 ACCEPTED SOLUTION
Pragati11
Super User III
Super User III

Hi @MossyD ,

 

You can try a calculated column as follows:

UPN = IF(RELATED(users[userPrincipalName]) = BLANK(), "No Record", RELATED(users[userPrincipalName]))

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

2 REPLIES 2
MossyD
Regular Visitor

Thank you @Pragati11 

Yes. Your solution worked for me.

I also, worked out the following solution...

UPN =
VAR UPNList = RELATED(users[userPrincipalName])
RETURN
IF(UPNList = "", "No Record", UPNList)
Pragati11
Super User III
Super User III

Hi @MossyD ,

 

You can try a calculated column as follows:

UPN = IF(RELATED(users[userPrincipalName]) = BLANK(), "No Record", RELATED(users[userPrincipalName]))

 

Thanks,

Pragati





If this helps, Appreciate a KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

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

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.