The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi,
I have one expression that works for only one value but having issues trying to expand it for three.
Example - That works for just counting how many times APPLE is listed in the Fruit Column
I want to count how many times, APPLE, PEAR or PLUM are in the same column.
Any Help?
Solved! Go to Solution.
Hi @chris_jones - use the OR command or the || method
Total Count =
CALCULATE ( COUNTROWS ( 'MyData' ),
OR('MyData[Fruit] = "APPLE", OR('MyData[Fruit] = "PEAR", 'MyData[Fruit] = "PLUM")))
Total Count =
CALCULATE ( COUNTROWS ( FILTER( 'MyData' ),
'MyData[Fruit] = "APPLE" || 'MyData[Fruit] = "PEAR" || 'MyData[Fruit] = "PLUM"))
Either of those should work.
Hope this helps
David
Total Count = CALCULATE ( COUNTROWS ( 'MyData' ), 'MyData[Fruit] in { "APPLE","PEAR","PLUM" } )
Hi @chris_jones - use the OR command or the || method
Total Count =
CALCULATE ( COUNTROWS ( 'MyData' ),
OR('MyData[Fruit] = "APPLE", OR('MyData[Fruit] = "PEAR", 'MyData[Fruit] = "PLUM")))
Total Count =
CALCULATE ( COUNTROWS ( FILTER( 'MyData' ),
'MyData[Fruit] = "APPLE" || 'MyData[Fruit] = "PEAR" || 'MyData[Fruit] = "PLUM"))
Either of those should work.
Hope this helps
David
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |