Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 ID | Factory ID | Amount | Amount (new) |
1 | 1 | € 432,00 | € 432,00 |
1 | 1 | € 432,00 | |
1 | 1 | € 432,00 | |
1 | 1 | € 432,00 | |
1 | 2 | € 869,00 | € 869,00 |
1 | 2 | € 869,00 | |
1 | 2 | € 869,00 | |
1 | 2 | € 869,00 |
Solved! Go to Solution.
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:
Step1:
For reference:
Create Row Number for Each Group in Power BI using Power Query
Step2:
Result is as below.
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.
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:
Step1:
For reference:
Create Row Number for Each Group in Power BI using Power Query
Step2:
Result is as below.
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.