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
johndolan2
Resolver I
Resolver I

If Contents of one cell is the same as another based on another column

Hi - Can you help ... I am trying to add a column that shows whether both components of a service ID are in the same or different states. ...  If they are in the same state I would like the result in the new column (Requested Result) to show "intra state" and if not then show "inter state".

 

*** There are 2 components to each Service ID. So in the example of service ID "123" since both of the A location and Z location components are in Florida my requested result would be Intra state.

 

I have a few thousand rows of these.

 

Thanks, John

 

Component          State       Service ID        Requested Result  
A Location     Florida   123   Intra state  
Z Location      Florida   123   Intra state  
A Location      New York        456   Inter state  
Z Location      Iowa   456   Inter state  
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@johndolan2 , Try a new column like

 

new column =
var _cnt = calculate(distinctCOUNT(Table[State]), filter(Table, [Service ID] = earlier([Service ID])))
return
if(_cnt >1, "Inter state", "Intra state")

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

View solution in original post

2 REPLIES 2
johndolan2
Resolver I
Resolver I

Amit - You are unbelievable .... You just answered 2 of my questions in a matter of minutes!!!

 

Thank you so very, very much!

 

John

amitchandak
Super User
Super User

@johndolan2 , Try a new column like

 

new column =
var _cnt = calculate(distinctCOUNT(Table[State]), filter(Table, [Service ID] = earlier([Service ID])))
return
if(_cnt >1, "Inter state", "Intra state")

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