March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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)
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
105 | |
98 | |
65 | |
54 |