Forum Discussion
Comparing text values from columns in two different Tables
I have two datasets:
webfact
| Page | Tags_Fact | Visits | Bounces |
| fruits.com | fresh, frozen | 1 | 1 |
| fruits.com | frozen | 2 | 1 |
| fruits.com | fresh, organic, red | 5 | 2 |
| fruits.com | fresh, GA | 2 | 1 |
| fruits.com | CA | 7 | 1 |
dimSegments
| Segment | Tags_dim |
| Fresh or Frozen | fresh or frozen |
| US | CA or FL or GA |
When someone selects Fresh or Frozen from dimSegment, I expect to see this:
| Page | Tags | Visits | Bounces |
| fruits.com | fresh, frozen | 1 | 1 |
| fruits.com | frozen | 2 | 1 |
| fruits.com | fresh, organic, red | 5 | 2 |
| fruits.com | fresh, GA | 2 | 1 |
When someone selects US from dimSegment, I expect to see this:
| Page | Tags | Visits | Bounces |
| fruits.com | fresh, GA | 2 | 1 |
| fruits.com | CA | 7 | 1 |
dimSegments contains hundreds of Segment and Tag combinations so I would prefer not to manually assign each condition individually. Is there a way to do this via DAX or Power Query? I'm even open to parameters nested in SQL statements via Advanced Editor.
This is obviously not correct but this is what my brain has conjured up:
if Text.Contains(webfact.Tags_Fact, dimSegments.Tags_Dim) then dimSegments.Segment
nancyvangrrr 1st part of this video here:
5 Replies
- parry2kSuper User
nancyvangrrr I have two videos coming on something similar, maybe that will help meet your requirements. These videos will be published in the next 1-2 days.
- parry2kSuper User
nancyvangrrr 1st part of this video here:
- nancyvangrrrFrequent Visitor
This is brilliant and exactly what I needed. Thank you so much!
- parry2kSuper User
nancyvangrrr glad it worked out for you - 2nd video is almost ready and will share the link here, and hopefully that will help to extend your solution. This is great news. Cheers!!
- parry2kSuper User
nancyvangrrr here is part 2 video. Thank you!