Forum Discussion
Count a Measure or Countif
Hi Corleen
This worked for me (I think)
# Times = CALCULATE(
COUNTROWS('Table1'),
FILTER(
'Table1',
'Table1'[SYSTEM_NUM] = MAX('Table1'[SYSTEM_NUM])
)
)
Thank you for your reply.
But it is a measure not a calculated column
For eg.
Trans Once = count([# times] = 1) I want the answer for this, how to do this?
Trans Twice = count([# times] = 2) ect.
where
[# times] = CALCULATE(COUNT('TransDetail'[SYSTEM_NUM]),'TransDetail'[EARN_DEDUCT_IND]=1) (this is a measure)
Thanks
- Amratya9 years agoAdvocate I
Can you try the same formula for the measure and check what it results?
- Corleen9 years agoRegular Visitor
# times =
CALCULATE(
COUNTROWS('TransDetail'),
ALLEXCEPT('TransDetail',
'TransDetail'[SYSTEM_NUM],
'TransDetail'[EARN_DEDUCT_IND]=1) 'the underline part gives an error'
)t
! A single value for column EARN_DEDUCT_IND in TransDetail cannot be determined. THis can happen when a measure formula to a column that contains many values without specifying an aggregation such as min, max, count or sum to get to a single result.
Is this what you meant?
- Amratya9 years agoAdvocate I
remove =1