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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Match values from two columns in a table where rows are unmatched

Hello experts,
came across an interesting but simple problem that I am not able to resolve myself.
Row.......... Country...........Rank...........Designated
1.................... A ............... 1
2......................B .........................3
3............................................................................ A

I have to make another column In same table where it says ‘yes’ in row 1 as country A is present in column designated.

Any idea how to do that?
Thanks in advance
1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on the data you provided, I created a calculated column.

Column = IF(CONTAINS('Table','Table'[Designated],"A")&&'Table'[Row]=1,"Yes")

test_yes.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

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

=IF(COUNTORWS(Data),FILTER(Data,Data[Designated]=EARLIER(Data[Country]))>0,"Yes","No")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks to all of you.
I ended up using one from here,



V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on the data you provided, I created a calculated column.

Column = IF(CONTAINS('Table','Table'[Designated],"A")&&'Table'[Row]=1,"Yes")

test_yes.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.

az38
Community Champion
Community Champion

Hi @Anonymous 

try a measure

Measure = 
var _isDesignated = CALCULATE(COUNTROWS(Table), FILTER(ALL(Table), Table[Designated]=SELECTEDVALUE(Table[Country]) && NOT(ISBLANK(SELECTEDVALUE(Table[Country]))) ) )
RETURN 
IF(_isDesignated > 0, "yes", "no")

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Thanks .

But not working.
Anything I could do in query editor? Or if the columns are in different table, can we do something to match up rows and create another table?

Can you share better sample data and sample output.

az38
Community Champion
Community Champion

@Anonymous 

how does your data look exactly in origin data source? the same as in the first post?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.