Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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] )
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
6 |