Enumlist Count

Hi 

I want to count a specific element in an enum list how to do that?

I tried this but result is 0

COUNT(SELECT(ORDERLINE[Item], IN([Item], {"B"})))

[Item] is the enumlist clm. 

Please help. 

 

 

0 12 376
12 REPLIES 12

Try to use.. COUNT(SELECT(ORDERLINE[YourKeyColumn], IN("B",[Item])))

On a specific row, how do I count this?

Example 

I select A,B,C, under an order line id and then under "A" Clm I want the total count of A i selected. when i used the expression u gave it gives a wrong value and goes to all the row

I gave  COUNT(SELECT(ORDERLINE[Order Line ID], IN("A",[_THISROW].[Item]) 

but it counts as "2" when it supposed to be 1 

If you count it in another table (not in Orderline), you should have..

COUNT(SELECT(SourceTable[KeyColumn],IN([Item],[EnumList]))). You don't need to use [_THISROW].[Item]. I'm assuming that you are selecting the letter in the [Item] column.

Im counting in same table

Orderline - Table

[Item] - Clm which has enum list (A,B,C)

 

Do you want to count it only from the same row.. or from the whole table?

only from row... also let me know abou table to. advice me both

So.. let me try to summarize what you are trying to do.
- You have a row in "Orderline" table
- You have an EnumList column called "Item"
- You can select three different values.. A, B and C
- Now you want to count how many times the B is selected in the Enumlist column
Is my assumption correct?

Exactly

But if it's an EnumList, you are able to select the "B" only once. Wouldn't it be easier to just check if the EnumList contains the "B"?

yes

Then it's just simple as IN("B",[Item])

Top Labels in this Space