How to Create a New Column in Power BI from Values from a Second Table

Abstract: Resolve missing data by creating calculated columns in Power BI using RELATED or LOOKUPVALUE to pull values from related tables.

Created: 2026-09-04 by
To create a new column in Power BI using values from a second table, you must first establish a relationship between the two tables within the Model view. Once linked, use DAX functions like RELATED to pull single-value data or LOOKUPVALUE for complex lookups directly into your primary table’s columns. This approach ensures dynamic updates and maintains data integrity without manual copying.

Establishing Table Relationships

The foundation of cross-table data retrieval in Power BI is the relationship model. Before writing any formulas, you need to connect the table containing your primary data with the table holding the reference values. Navigate to the Model View by clicking the icon on the left sidebar that resembles a diagram. Here, you will see all your imported tables as boxes. Drag a field from one table (typically a key field like an ID or code) and drop it onto the corresponding field in the other table. Power BI will automatically detect the cardinality, usually creating a one-to-many relationship where the "one" side is the lookup table and the "many" side is your fact table. Ensure the cross-filter direction is set appropriately; typically, single direction filtering is preferred for performance unless you have a specific need for bidirectional filtering. If the relationship is not active, DAX functions cannot traverse between these tables efficiently. For users who prefer to clean their source data before loading it into the model, consider how external files are handled. You can find more details on optimizing external sources in Power BI Uses Excel File: Slim Down Table Values with Custom Columns in Power Query. While Power Query is excellent for merging tables during the ETL process, creating calculated columns via DAX allows for real-time calculation based on the current filter context.

Using the RELATED Function

Once the relationship is established, the most straightforward method to bring in a value is the RELATED function. This function works best when the relationship is one-to-one or many-to-one from the perspective of the table where you are adding the column. Open the table where you want the new column to appear and switch to the Data View. Click on New Column in the ribbon. Enter the following formula:
=RELATED(TableName[ColumnName])
Replace TableName with the name of the related table and ColumnName with the specific field you wish to extract. For example, if you have a Sales table and a Product table, and you want the product category in the Sales table, the formula would be =RELATED(Product[Category]). The RELATED function looks up the value in the related table that matches the current row's context based on the active relationship. It returns a blank if no match is found, which helps identify orphaned records. This method is highly efficient because it leverages the underlying VertiPaq engine's compression and indexing. However, it requires that the relationship exists and is active. If you attempt to use RELATED across multiple relationships or without a direct link, Power BI will return an error. Always verify that the data types of the linking fields match exactly; a mismatch between text and number formats can prevent the relationship from working correctly.

Implementing LOOKUPVALUE for Flexibility

While RELATED is simple, it relies strictly on existing relationships. Sometimes, you may need to look up a value without a defined relationship, or you might need to search based on multiple criteria. In such cases, the LOOKUPVALUE function provides greater flexibility. It searches for a result column based on one or more search columns. Use this syntax:
=LOOKUPVALUE(Result_ColumnName, Search_ColumnName, Search_Value, [Search_ColumnName, Search_Value]...)
For instance, to find a price based on both a Product ID and a Region, you might write:
=LOOKUPVALUE(PriceTable[Price], PriceTable[ProductID], Sales[ProductID], PriceTable[Region], Sales[Region])
This function iterates through the specified table to find matching rows. Note that LOOKUPVALUE can be slower than RELATED on large datasets because it does not leverage the same optimized relationship paths. Use it sparingly and only when necessary. Also, ensure that the search returns a unique value; if multiple rows match, LOOKUPVALUE will throw an ambiguity error. To avoid this, combine search terms to ensure uniqueness.

Performance Considerations and Best Practices

Adding calculated columns increases the size of your .pbix file because the results are stored physically in the model, unlike measures which are calculated on the fly. Therefore, evaluate whether a calculated column is truly needed. If the data is static, consider merging the tables in Power Query instead. This reduces the model size and simplifies the DAX logic. If you must use calculated columns, keep the formulas simple. Avoid complex iterations or heavy string manipulation. Regularly check your report's performance using Performance Analyzer to ensure that these columns do not bottleneck your visual rendering. Additionally, maintain a clear naming convention for your columns and tables to make future maintenance easier. Understanding how to pass data effectively is crucial; you can learn more about handling Excel data imports in Passing Excel Column Data to Power BI Desktop: A Filter Data Guide.

Verifying Your Results

After creating the column, inspect the first few rows to ensure the values populate correctly. Check for blanks, which may indicate missing relationships or unmatched keys. Use the ISBLANK function in a conditional column if you need to replace blanks with default values. Consistent formatting across your data models prevents display issues later.

Frequently Asked Questions

Can I use RELATED if there is no relationship between the tables?

No, the RELATED function strictly requires an active relationship between the tables. Without a defined link in the Model view, Power BI cannot determine how to associate the rows, resulting in an error.

What is the difference between RELATED and LOOKUPVALUE?

RELATED uses existing relationships and is generally faster, while LOOKUPVALUE performs a direct search without needing a relationship but can be slower on large datasets. Choose RELATED for standard joins and LOOKUPVALUE for ad-hoc lookups.

Will adding calculated columns slow down my report?

Yes, calculated columns increase file size and can impact load times because they store pre-calculated results. Measures are often preferred for dynamic calculations as they do not consume additional storage space.

How do I handle multiple matches with LOOKUPVALUE?

LOOKUPVALUE throws an error if multiple rows match the search criteria. To fix this, add more search columns to ensure the combination of values is unique, or use VALUES if you intend to aggregate the results.

Is it better to merge tables in Power Query or use DAX?

Merging in Power Query is often better for static data as it reduces model complexity and file size. Use DAX calculated columns when you need dynamic calculations that respond to user filters or require complex business logic not easily expressed in M code.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More