Forum Discussion
Combine 2 colums into 1
Hi,
I have one table (apps) which has app_id and app_status
Within this table, some app_id have a blank apps_status.
However, my 2nd table (app_lookup) has all the app_id that are missing an app_status in the apps table.
I have joined the 2 tables on app_id.
What I want is the values from the app_lookup table to fill in the blanks on the app_status within the apps table.
Any idea how to do this please?
M_SBS_6- Check this out.
App Status Filled = IF( ISBLANK('apps'[app_status]), RELATED('app_lookup'[app_status]), 'apps'[app_status] )
3 Replies
- Manoj_Nair
Solution Supplier
M_SBS_6- Check this out.
App Status Filled = IF( ISBLANK('apps'[app_status]), RELATED('app_lookup'[app_status]), 'apps'[app_status] ) - Ritaf1983
Super User
Hi M_SBS_6
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - rubayatyasmin
Community Champion
Hi, M_SBS_6
you can achieve the same result by performing a Merge operation and then expanding the values from the lookup table to fill in the blanks in the original table. Here's how you can do it:
Step 1: Merge the tables
- In Power BI, go to the "Home" tab.
- Click on "Manage Relationships."
- Ensure there is a relationship between the "app_id" columns in both tables. If not, create a relationship between the "app_id" columns of the "apps" and "app_lookup" tables.
Step 2: Perform the Merge
- Go back to the "Home" tab.
- Click on "Transform Data" to open Power Query Editor.
- In Power Query Editor, select the "apps" table.
- Click on the "Merge Queries" dropdown in the "Home" tab.
- Choose "Merge Queries as New" from the dropdown menu.
- In the "Merge" dialog box, select the "app_id" column from the "apps" table as the key column, and select the "app_id" column from the "app_lookup" table as the related column.
- Choose "Left Outer" as the join kind.
- Click "OK" to perform the merge.
Step 3: Expand the values from the lookup table
- After the merge, you'll see a new column in the "apps" table containing a table with the data from the "app_lookup" table.
- Click on the double-arrow icon on the new column header to expand the values from the lookup table.
- In the "Expand" dialog box, select the columns you want to fill in the blanks (e.g., "app_status").
- Click "OK" to apply the expansion.
Step 4: Remove unnecessary columns You can remove the merged column from Step 2 and any other columns that you no longer need for your analysis.
Step 5: Load the data After making all the necessary transformations, click "Close & Apply" to load the data back into Power BI. The blanks in the "app_status" column in the "apps" table should now be filled with the values from the "app_lookup" table.
Please note that these steps are specific to Power BI and may vary slightly depending on the version of Power BI you are using