Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I've seen that it is possible to use the "IN" operator in this manner:
Products[Color] IN { "Red", "Black" }
Now, for a my pbix I'd like to use a similar logic:
Products[Color] IN Colors[Color]
like a SQL query, but it seems that it isn't possible, right?
Any suggests for me, please? Thanks
Hey @Anonymous ,
instead of Products[Color] IN { "Red", "Black" } you can also write:
TREATAS ( { "Red", "Black" }, Products[Color] )
Similar you can use the TREATAS function to use the values from another column as a filter for your desired column. You could use:
TREATAS( VALUES( Colors[Color] ), Products[Color] )
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 10 | |
| 10 | |
| 6 | |
| 6 |