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.
I have a table. I need to create a column filtering on two of the values. - apples and pears. Previously I only needed to filter on 1 so used the below to create a column. Can it be adapted to cover the two values?
Solved! Go to Solution.
So you want a calculated column?
No of Apples and Pears := IF('table'[Category] IN {"Apples", "Pears"}, 1, 0)
Hi lennox,
you have two options:
1- if you only need 2 values then use the below
No of Apples = If(OR('table'[Category] = "Apples",'table'[Category] = "Pears"), 1, 0)
2- if you have more than 2
No of Apples = If('table'[Category] in { "Apples", "Pears","Anyother"} , 1, 0)
If my reply helped you solve the problem please accept it as the solution 🙂
Thank you - the more than two -that will help me in the future 🙂
So you want a calculated column?
No of Apples and Pears := IF('table'[Category] IN {"Apples", "Pears"}, 1, 0)
Perfect - Thank you!
User | Count |
---|---|
73 | |
72 | |
39 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
50 | |
43 | |
42 |