This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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
Solved! Go to Solution.
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()
)
@tex628 Hi,
I dont need date column. Only customer Key, Name and the measure. For those customers below it must return true
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()
)
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 38 | |
| 37 | |
| 31 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 76 | |
| 59 | |
| 31 | |
| 31 | |
| 25 |