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
ssjordan95
New Member

Data puzzle with great value!

Hello! I am new to Power BI and trying to do somethign quite complicated - or so I believe. I have two columns, one with let's say 'numbers X'. I have another column with let's say 'numbers Y'. I would like to return all X values with the same Y value for selected values in column 'numbers X', but not returning a repeat within a selected value from 'numbers X'. The issue I am running into is the lookup function is returning a repeat selected value for itself. See example below. '1' and '2' would be returned because it was found with same 'numbers Y'. '4' would not be returned because 'numbers Y' did not have a repeat value outside of itself. 

numbers Xnumbers YSelected Values (drop down of 'numbers X')Results ('numbers X' with same values in 'numbers Y')
11011
11222
1104 
210  
215  
213  
310  
39  
36  
47  
427  
49  
47  



1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @ssjordan95 
Please find attached sample file with the solution

1.png2.png

Filter Measure = 
VAR T1 = 
    VALUES ( 'Table'[numbers Y] )
VAR T2 = 
    CALCULATETABLE ( 
        VALUES ( 'Table'[numbers Y] ),
        EXCEPT ( ALLSELECTED ( 'Table'[numbers X] ), VALUES ( 'Table'[numbers X] ) )
    )
VAR T3 =
    INTERSECT ( T1, T2 )
RETURN
    IF ( 
        NOT ISEMPTY ( T3 ),
        1
    )

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @ssjordan95 
Please find attached sample file with the solution

1.png2.png

Filter Measure = 
VAR T1 = 
    VALUES ( 'Table'[numbers Y] )
VAR T2 = 
    CALCULATETABLE ( 
        VALUES ( 'Table'[numbers Y] ),
        EXCEPT ( ALLSELECTED ( 'Table'[numbers X] ), VALUES ( 'Table'[numbers X] ) )
    )
VAR T3 =
    INTERSECT ( T1, T2 )
RETURN
    IF ( 
        NOT ISEMPTY ( T3 ),
        1
    )

Thank you very much! If I could give you a hug, I would. 

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.

Top Solution Authors