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

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.

Reply
Anonymous
Not applicable

add column based on selected value

Need help.

Say I have two table 1 and table 2. I am using the Col 1 from Table 1 in a slicer and I have created a measure using SELECTEDVALUE on this column. Say I have selected Value 2.

Now in table 2, I want to add a column (Col 3) which contains 1 or true wherever Col 2 contains this selected value.

 

Table 1
Col 1
Value 1
Value 2
Value 3

 

Table 2  
Col 1Col 2Col 3
TV1Value 10
TV2Value 21
TV3Value 30
TV4Value 21
TV5Value 10

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could create a measure like this:

Measure = IF(MAX('Table (2)'[Col 2])in VALUES('Table'[Col 1]),1,0)

test_selected-value.PNG

 

Best Regards,
Liang
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

6 REPLIES 6
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could create a measure like this:

Measure = IF(MAX('Table (2)'[Col 2])in VALUES('Table'[Col 1]),1,0)

test_selected-value.PNG

 

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

Anonymous
Not applicable

Are you talking about a measure to be placed in a visual or about a calculated column?

If you mean a calculated column, then the answer is simple: you cannot do it. Values in the columns of model tables are always static.

Best
D
Anonymous
Not applicable

@Anonymous Can we put a measure in a visual like a table to filter the details. My ultimate goal is that only. This was a workaround I thought of.

 

In this method, I want to create a column in an existing table (Table 2) based on a selected value from table 1.

Anonymous
Not applicable

Yes, that you can do 🙂

Best
D
bheepatel
Resolver IV
Resolver IV

Hi @Anonymous 

 

Can you try creating the following measure:

 

Col3 = IF( CONTAINS(Table2, Col2, SELECTEDVALUE(Col1)),  1, 0)

Anonymous
Not applicable

@bheepatel it didn't work. all values are coming as zero

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors