Power BI Uses Excel File: Slim Down Table Values with Custom Columns in Power Query

Abstract: Resolve large file sizes and poor performance in Power BI by moving Excel calculations to custom columns in Power Query.

Created: 2026-09-10 by
Optimize your Excel data for Power BI by adding calculated columns directly in Power Query. This approach reduces file size and improves performance by moving logic from the final dataset into the transformation layer. You can create custom formulas that clean, merge, or derive new metrics before the data ever reaches your visualizations, ensuring a leaner and more efficient model.

Why Move Calculations to Power Query?

When you build reports in Power BI using Excel files as sources, the way you structure your data significantly impacts performance. A common mistake is creating complex calculations within DAX measures or even Excel formulas that are not optimized for large datasets. By shifting these calculations to Power Query, you perform them during the data load phase rather than at query time. This results in a smaller memory footprint because the transformed data is stored in the compressed VertiPaq engine format.

Custom columns in Power Query allow you to manipulate text, numbers, and dates efficiently. For example, if you have separate columns for "First Name" and "Last Name," combining them into a single "Full Name" column in Power Query reduces the number of columns and simplifies your data model. This process is particularly useful when dealing with messy Excel exports where formatting inconsistencies often exist. It ensures that your data is consistent and ready for analysis without requiring post-load cleaning steps.

Accessing Power Query Editor

To begin optimizing your Excel table, you must first import the data into Power Query. Open Power BI Desktop and select Get Data from the Home ribbon. Choose Excel Workbook and navigate to your source file. In the Navigator window, select the specific sheet or table you wish to use. Instead of clicking Load, always click Transform Data. This action opens the Power Query Editor, which is the environment where you will apply your custom logic.

The Power Query Editor provides a visual interface for every step of your data transformation. On the right-hand side, you will see the Applied Steps pane, which logs each modification you make. This feature allows you to review, reorder, or delete previous steps if you need to adjust your logic later. It creates a reproducible pipeline, meaning that if your Excel source updates, you can refresh the query, and all custom columns will be recalculated automatically based on your defined rules.

Creating Custom Columns for Slimming Data

The core of this optimization technique involves adding custom columns to reduce redundancy and derive necessary values early. Select the Add Column tab in the Power Query Editor ribbon and choose Custom Column. A dialog box will appear asking for a New Column Name and a Custom Column Formula. Here, you can write M language expressions to transform your data.

For instance, consider a scenario where you have transaction dates and need to extract the fiscal year for reporting. You might use a formula like Date.Year([TransactionDate]). By creating this column in Power Query, you avoid having to calculate the year repeatedly in DAX. Furthermore, you can combine multiple columns into one to simplify your visual fields. If you have City and State columns, you can merge them into a single Location column using a text join function. This reduces the cardinality of your data model and makes it easier to filter and group in your reports.

Another common use case is cleaning text data. If your Excel source contains leading or trailing spaces, or inconsistent capitalization, you can use functions like Text.Trim() and Text.Upper() within a custom column. This ensures that your data is standardized before it enters the model, preventing issues with distinct counts and filters. Remember to check the data type of your new column immediately after creation to ensure compatibility with subsequent operations.

Managing Dependencies and Performance

While custom columns are powerful, they should be used judiciously to maintain performance. Each custom column adds a row to your query history, which can slow down the refresh process if the underlying data is massive. To mitigate this, try to combine multiple transformations into a single custom column where possible. For example, instead of creating one column for trimming text and another for converting to uppercase, do both in one formula.

Additionally, be mindful of circular dependencies. If a custom column references another custom column that was created later in the step order, Power Query will throw an error. Always arrange your steps logically, starting with basic cleaning and moving towards more complex derivations. You can drag and drop steps in the Applied Steps pane to reorder them easily. This ensures that each calculation has access to the data it needs without referencing future states.

It is also beneficial to remove unnecessary columns before applying heavy custom logic. The fewer columns you carry forward, the less memory Power Query needs to allocate during transformation. Use the Remove Columns option to discard IDs or metadata that are not required for your analysis. This practice aligns with the principle of slimming down your table values, making the final dataset as lean as possible.

Integrating with Broader Data Strategies

Optimizing your Excel data in Power Query is just one part of a robust data strategy. Once your data is cleaned and structured, you may need to relate it to other tables or apply advanced filtering. Understanding how to handle related data sources is crucial for building comprehensive dashboards. For more insights on connecting different data sources, you might find Passing Excel Column Data to Power BI Desktop helpful.

Furthermore, as your data grows, you may encounter nested structures or complex relationships that require deeper exploration. Knowing how to manage these complexities ensures that your report remains responsive. Exploring techniques for handling nested data can provide additional tools for refining your input sources. Consider reviewing How to Open Nested Tables from Power Query in New Sheets to expand your capabilities in managing intricate Excel formats.

Frequently Asked Questions

Can I edit a custom column after it has been added?

Yes, you can edit any custom column by selecting it in the Power Query Editor and modifying the formula in the formula bar. The change will be reflected in all downstream steps and visualizations upon refresh. Always verify that the data type remains correct after editing to avoid calculation errors.

Does using custom columns increase the file size of my Power BI report?

No, using custom columns typically decreases the effective size of your data model. By performing calculations during the load phase, you store only the final result in the VertiPaq engine, rather than storing raw data and calculating it dynamically. This compression leads to faster query performance and smaller .pbix files.

What happens if my Excel source changes format?

If the structure of your Excel file changes, such as a column being renamed or removed, your Power Query steps may fail. You will need to update the step names in the Applied Steps pane to match the new structure. Keeping your queries flexible by using dynamic references can help minimize manual adjustments.

Is M language difficult to learn for custom columns?

M language is relatively intuitive for basic tasks, especially since Power Query provides a GUI builder for many common functions. For simple additions, concatenations, and date extractions, you rarely need to write code manually. However, mastering M allows for more complex logic and better troubleshooting when standard options are insufficient.

Should I use DAX or Power Query for all calculations?

Use Power Query for data shaping, cleaning, and deriving static attributes that do not change based on user interaction. Use DAX for dynamic calculations that depend on filters, context, and aggregations. Splitting responsibilities between the two layers ensures optimal performance and maintainability.

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