Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello, I would like to create a measure that returns the count of the rows of a table. I am able to use CALCULATE with a single value in the filter expression to get the measure to return the correct count of rows that contain that single value in that column. But I want to filter for not just one value, but for a handfull of values. Anyone know how to do this?
Here's a screenshot:
This successfully returns the number of rows with "Open" in the Stage column, but I want to return the number of rows that contain "Open", "Design" and others.
Solved! Go to Solution.
You can use double pipe || as a logical or
=CALCULATE([measure], table[column 1] = 1 || table[column 1] = 2)
Or is a function that takes 2 parameters. Double pipe || is an inline syntax and you can have as many as you need.
Matt gave it, above. I used "Doublepipe" ||
You can use double pipe || as a logical or
=CALCULATE([measure], table[column 1] = 1 || table[column 1] = 2)
what does [measure] mean in your example?
When I use that formula, I get the error "The expression contains multiple columns, but only a single column ca be used in a True/False expression that is used as a table filter expression".
My measure is: COUNTA('table[Column])
That works, thank you!!
Or is a function that takes 2 parameters. Double pipe || is an inline syntax and you can have as many as you need.
Hello Matt,
Is there a way to use the || to sort byt two columns?
I have a total ranking of mutiple columns columns. However, I also have a column with the number of surveys the customer took. I need to rank all customers with more than 10 surveys in the upper half of my table but then I also need to rank those with less than 10 surveys in the lower half of the table. Any suggestion on how to do that?
Thank you,
Lukas
I'm not clear on what you mean by "rank". If you need to filter a table based on the values in 2 different columns
eg table[Col1] >=10 or table[Col2] <=10 then I would normally do this as follows
UNION(
filter(table,table[col1]>=10),
filter(table,table[col2]<=10)
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
77 | |
72 | |
56 | |
40 | |
35 |
User | Count |
---|---|
71 | |
65 | |
57 | |
49 | |
47 |