How to Repeat Column Values Based on Another Column in Power BI
Question details
The user needs to repeat or fill a specific value in one column based on a matching condition or value found in another column.

- Product
- Power BI
- Device & OS
- not provided
- Scenario
- Transforming and modeling data to ensure specific rows inherit values based on a corresponding identifier, such as a sales order number.
- Observed behavior
- Looking for the correct DAX or Power Query methodology to dynamically populate a column's values based on related column data.
Ensure your dataset is successfully imported into Power BI Desktop and identify the specific key column that will act as the logical condition for repeating your values.
Use Power Query to Add a Conditional Column
Power Query is the most efficient way to transform data before loading it into your model by adding conditional logic to generate repeating values.
Performing row-level transformations in Power Query is generally recommended over using DAX. It improves model performance by processing the logic during the data load phase rather than calculating it on the fly.
Open Power BI Desktop and click on 'Transform Data' in the Home ribbon to launch the Power Query Editor.
From the Queries pane on the left side of the window, select the table you want to modify.
Navigate to the 'Add Column' tab at the top and click on 'Conditional Column'.
In the dialog box, set up your IF/THEN logic. For example: If 'Sales Order' equals '1001', then output 'a'. You can add multiple clauses as needed.
Click 'OK' to create the column, then go back to the Home tab and select 'Close & Apply' to save your transformations to the data model.

Create a Calculated Column Using DAX
You can use Data Analysis Expressions (DAX) to dynamically calculate and repeat values based on another column directly within the Data view.
Prepare and Clean Your Data Seamlessly with WPS Office
While Power BI is an excellent tool for data visualization, the process of cleaning and preparing data often begins in a spreadsheet. WPS Office provides a lightweight, highly compatible, and free alternative to Microsoft Office, making it incredibly easy to use VLOOKUP and IF functions to repeat column values before importing your datasets into BI tools.

Frequently Asked Questions
Can I use VLOOKUP in Power BI to repeat values like I do in Excel?
Power BI does not use the VLOOKUP function. Instead, you can use the LOOKUPVALUE DAX function or merge queries in the Power Query Editor to achieve the exact same result of pulling and repeating values based on matching columns.
How do I fill empty cells with the value from the row above in Power BI?
Open the Power Query Editor, select the column containing the null or empty cells, right-click the column header, select 'Fill', and then click 'Down'. This command will repeat the topmost value downwards until it encounters a new value.
Why is my DAX calculated column not returning the repeated values correctly?
Ensure that your DAX formula references the correct table and column names. If you are attempting to look up a value from an entirely different table, verify that a valid relationship exists between the two tables in your Data Model view.
Is it better to create conditional columns in Power Query or using DAX?
It is generally considered best practice to perform row-level transformations and create conditional columns in Power Query before the data loads. This method significantly improves overall model performance and allows for better data compression compared to DAX calculated columns.




