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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
my_microsoftacc
Frequent Visitor

Dax for: Create a new column where Value is equal value of one row before of the left column

Hi everyone,

I have multiple tables with the structure similar as the table below. Since it has the country and the company names in the same column, I would like to create a new column ("Country") where the value takes up the volumn of column A but a row before. (examples illustrated in yellow column)

Afterwards, I can filter out the rows where "plant location" is null to get the desired table of 3 columns "Company", "plant location", "Country"

my_microsoftacc_1-1700582396326.png

Or if anyone has any other ideas how to extract the country name and get the same results of a 3-column table, I would also very much appreciate.

 

Thanks!

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

if you add an Index column (using the interface) you can get the value of the column in the row prior:

 

#"Added Index"{[Index] - 1}[Company]

 

edit: power query solution

 

 

 

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

if you add an Index column (using the interface) you can get the value of the column in the row prior:

 

#"Added Index"{[Index] - 1}[Company]

 

edit: power query solution

 

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.