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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Cazz963
New Member

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

Hi

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

etc.....

 

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.

 

Thanks

 

R

2 REPLIES 2
ValtteriN
Super User
Super User

Hi,

Here is how to do this with a measure:

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

 

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

R

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.