Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi everyone,
I have to calculate a new column/measure that for each client it will take first from a different column. For instance, how to calculate City_new? Is it possible?
| Customer ID | City | City_new |
| 1 | Warsaw | Warsaw |
| 1 | Paris | Warsaw |
| 1 | London | Warsaw |
| 2 | Moscow | Moscow |
| 2 | Riga | Moscow |
| 3 | Vienna | Vienna |
| 3 | Warsaw | Vienna |
| 3 | London | Vienna |
| 3 | Lisbona | Vienna |
Best Regards!
Solved! Go to Solution.
Hey @Anonymous ,
you can add a calculated column and use the following formula:
City_new =
CALCULATE(
MAX( myTable[City] ),
ALLEXCEPT(
myTable,
myTable[CustomerID]
)
)
Be aware that this will just give you the last value from an alphabetical point of view. In general there is no order in the Power BI data. So ID 1 and Warsaw could in other circumstances appear as second row.
If you want to have a specific element as first, you have to add a column with the order of the cities.
Hey @Anonymous ,
you can add a calculated column and use the following formula:
City_new =
CALCULATE(
MAX( myTable[City] ),
ALLEXCEPT(
myTable,
myTable[CustomerID]
)
)
Be aware that this will just give you the last value from an alphabetical point of view. In general there is no order in the Power BI data. So ID 1 and Warsaw could in other circumstances appear as second row.
If you want to have a specific element as first, you have to add a column with the order of the cities.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 79 | |
| 38 | |
| 31 | |
| 27 | |
| 27 |