Showing results for 
Search instead for 
Did you mean: 
New Member

Replace, substitution value in column for another in same column based on another columns value


New to Power Bi.


I have the following extract from a table


Product code        Type                      Source             

B1wp2XXXX1       pre-process              J15

b1wp2XXXX1        post-process            GKV 1

b1wp2XXXX2       pre-process              j2

b1wp2XXXX2       post-process             GKV 2

B3WP2XXXX1      pre-process              j6

b3WP2XXXX1      post-process             GKV 9



So a "product code" has various "types" of process and "source". What I am after is a solution to change the "source" of the "pre-process" to corresponding "post-process" one for that product code ie for b1wp2xxxx1  J15 to GKV.


Tried various formulas, workarounds etc with no joy.





Super User
Super User


Here is how to do this with a measure:

Source measure = CALCULATE(MAX(Process[Source]),ALLEXCEPT(Process,Process[Product code]),Process[Type]="post-process")


Ping me with @ if you want to do this with calculated column or powerquery.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Hi Valtteri,

Thanks for the reply.

I maybe made the sample above too simple as there are many "types" to be considered and "sources"

After typing in the measure i get the error "A single value for column 'Source' in table xxxxx cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, mac, count, or sum to get a single result"


Thanks again


Helpful resources

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!