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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
acn_bi
Frequent Visitor

DAX or Power Query - Creating a new column with values from another column

Hi everyone,

 

I'm facing a problem and decided to ask the community for help.

 

I have a table with 3 columns - [Country ID], [Factory ID], and [Amount] - and I want to add a new column [Amount (new)] with the logic that's displayed on the example below. What's the best way to achieve this by using either DAX or PowerQuery?

 

Thank you!

 

Country IDFactory IDAmountAmount (new)
11 €   432,00 €             432,00
11 €   432,00 
11 €   432,00 
11 €   432,00 
12 €   869,00 €             869,00
12 €   869,00 
12 €   869,00 
12 €   869,00 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @acn_bi ,

 

I suggest you to add an index by group in Power Query Editor and then add a custom column by IF function.

My Sample:

RicoZhou_2-1662010833198.png

Step1:

For reference:

Create Row Number for Each Group in Power BI using Power Query

Step2:

RicoZhou_0-1662010802774.png

Result is as below.

RicoZhou_1-1662010819460.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @acn_bi ,

 

I suggest you to add an index by group in Power Query Editor and then add a custom column by IF function.

My Sample:

RicoZhou_2-1662010833198.png

Step1:

For reference:

Create Row Number for Each Group in Power BI using Power Query

Step2:

RicoZhou_0-1662010802774.png

Result is as below.

RicoZhou_1-1662010819460.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors