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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Fcoatis
Post Patron
Post Patron

Contains

Hello,

I need to create a measure to check values against a virtual table like this:

 

Test = 
VAR currCustomer = VALUES(Customer[CustomerKey])
VAR TempTable = FILTER(InternetSales,InternetSales[OrderDate]<DATE(2011,1,1))
RETURN
IF(
    HASONEFILTER(InternetSales[CustomerKey]),
    CONTAINS(TempTable,Customer[CustomerKey],currCustomer),
    BLANK()
)

But every record returns false. What am I doing wrong? Sample is Here

 

Thanks in advance

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Just replace ur measure with this;

Test = 
VAR currCustomer = SELECTEDVALUE(Customer[CustomerKey])
VAR TempTable = FILTER(InternetSales,InternetSales[OrderDate]<DATE(2011,1,1))
RETURN
IF(
    CONTAINS(TempTable,Customer[CustomerKey],currCustomer),
    TRUE(),
    FALSE()
)

Connect on LinkedIn

View solution in original post

4 REPLIES 4
tex628
Community Champion
Community Champion

Is this the desired result? 
image.png


Connect on LinkedIn

@tex628 Hi,

I dont need date column. Only customer Key, Name and the measure. For those customers below it must return true


Capturar.PNG

tex628
Community Champion
Community Champion

Just replace ur measure with this;

Test = 
VAR currCustomer = SELECTEDVALUE(Customer[CustomerKey])
VAR TempTable = FILTER(InternetSales,InternetSales[OrderDate]<DATE(2011,1,1))
RETURN
IF(
    CONTAINS(TempTable,Customer[CustomerKey],currCustomer),
    TRUE(),
    FALSE()
)

Connect on LinkedIn

@tex628 Thank you very much!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.