Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I want to compare 2 columns on same visual at a row by row level, if the name matches I want to either only show the columns that match, or at least mark them with a "yes" in a new column:
The relationship between both tables is Many to Many. I AM LOOKING FOR A SOLUTION WHICH DOESNT CHANGE THIS.
Basically in the below Visual, the columns of Sales person and User who did activity come from different tables with Many to Many relationship. All I want is that if Sales person says the same thing as User who did activity, then to mark it as "yes", or that the visual would only show those that match. (Expected result: row 1, 4, 7, 9 marked as "Yes" to match)
In excel I would simply add a new column and use =if(Sales person = User who did activity,"Yes", "No") ...but powerbi wont allow this because of the many to many relationship....and wont allow to use related function either.
Row | Sales Person | Sales Persons Customers | User who did activity |
1 | A | Customer 1 | A |
2 | A | Customer 1 | B |
3 | A | Customer 1 | C |
4 | A | Customer 2 | A |
5 | A | Customer 2 | B |
6 | B | Customer 1 | A |
7 | B | Customer 1 | B |
8 | B | Customer 2 | A |
9 | B | Customer 2 | B |
There has to be a "dumb" way to do this without going into the relationships!
Solved! Go to Solution.
Hi @Anonymous ,
Refer to the measure below.
Measure =
var a = SELECTEDVALUE('Table 1'[Sales Person])
var b = SELECTEDVALUE('Table 2'[User who did activity])
return
IF(a=b&&NOT(ISBLANK(a))&&NOT(ISBLANK(b)),"yes",BLANK())
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Refer to the measure below.
Measure =
var a = SELECTEDVALUE('Table 1'[Sales Person])
var b = SELECTEDVALUE('Table 2'[User who did activity])
return
IF(a=b&&NOT(ISBLANK(a))&&NOT(ISBLANK(b)),"yes",BLANK())
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
can you provide sample data for the two tables?
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
76 | |
61 | |
37 | |
33 |
User | Count |
---|---|
99 | |
56 | |
51 | |
42 | |
40 |