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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
rclay78
Frequent Visitor

Create a new column based on values of two columns, but matching based on certain column

I have been trying to figure this out and have failed. I have tried New Column = Calculate('table1'[Column1], 'table1'[Column2] in {1}), but it only duplicated whats in Column 2. I basically just want to create a new column where it returns a 1 if any row >=1 for the same Column1 value. 

 

Column1Column2New Column
11AA11
11AA21
11AA11
11AA01
11B200
11B200
222211
222201
333300
333300
444411
444431
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@rclay78 

You may create this column: 

Column = IF(CALCULATE(MAX([Column2]),ALLEXCEPT('Table','Table'[Column1]))>=1,1,0)
 

V-pazhen-msft_0-1611629491763.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@rclay78 

You may create this column: 

Column = IF(CALCULATE(MAX([Column2]),ALLEXCEPT('Table','Table'[Column1]))>=1,1,0)
 

V-pazhen-msft_0-1611629491763.png


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@rclay78 , Create a new column like

 

new column =
var _cnt = countx(filter(Table, [Column1] = earlier([Column1]) && [Column2]>=1), [Column1])
return
if(isblank([_cnt]),0,1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.