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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
ccianci
Frequent Visitor

Fixing inconsistent names & missing titles

Hello all,

 

I have two issues I'm hoping you can help me with.  I'm fairly new to Power BI & Power Query and i'm working on a PBI report comparing joiners vs leavers over the last x years.  For your reference, the raw data file actually uses the values "joiners" and "leavers":

  1. One issue is the employee title.  In the query, all new hires have a title but the leavers do not.  My thought to get some of the data fixed is to do an XLOOKUP or similar formula.  Basically, it would be something like this - if the leaver's title is empty, then search all joiners for the full name.  if there's a match, copy the title over.  I know this wont fix all leavers but it should fix some. Since all the joiners and leavers are in one table, i thought it would be easiest to duplicate the query so there's one for joiners and one for leavers.  not sure if that helps or just makes things harder.

  2. The second issue is related to the one above.  I can't search for the user's name because the "full name" column was poorly entered by HR.  Some names are FIRST LAST and some are LAST, FIRST.  Some even have two spaces between FIRST LAST.
    Is there a power query formula I can use to clean this up or maybe create a new column with a uniform value - FIRST LAST?

 

Thank you for your help.

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @ccianci ,

 

You may add a new column:

Filled Title = 
var _title= CALCULATE(MAX('Table'[Title]),ALLEXCEPT('Table','Table'[Email]))
return IF([Title]=BLANK(),_title,[Title])

Eyelyn9_0-1654054351724.png

 

Best Regards,
Eyelyn Qin
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

4 REPLIES 4
v-eqin-msft
Community Support
Community Support

Hi @ccianci ,

 

You may add a new column:

Filled Title = 
var _title= CALCULATE(MAX('Table'[Title]),ALLEXCEPT('Table','Table'[Email]))
return IF([Title]=BLANK(),_title,[Title])

Eyelyn9_0-1654054351724.png

 

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

ccianci
Frequent Visitor

Thank you both.  Here's a sample data (cleaned for privacy) of what I'm talking about:

 

ItemFull NameNameEmailTitleStart DateLeaving Date
JoinerDoe, John jdoe@email.comVice President2022-05-16 
JoinerLow, Karen klow@email.comConsultant2022-03-21 
Leaver Karen Lowklow@email.com  2022-05-15

 

First issue: Leaver title is missing (line 4) but since that same employee joined this year (line 3).  Is there a way to do a search in Power Query (or dax) to fill in that title?  If the search returns nothing, then leave the title blank.

 

Second issue: cancel this one - i figured out a solution using Power Query

v-eqin-msft
Community Support
Community Support

Hi @ccianci ,

 

Any updates?

As @lbendlin mentioned , the information you have provided is not making the problem clear to us, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,
Eyelyn Qin

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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