Forum Discussion
Count a Measure or Countif
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
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
- Corleen9 years agoRegular Visitor
I have removed the 1 and it gives me a result.
But not the result what I want.
Would please explain the Measure to me
Thank you
- v-caliao-msft9 years agoMicrosoft Employee
Please try the DAX below.
# times =
CALCULATE(
COUNTROWS('TransDetail'),
FILTER(ALLEXCEPT('TransDetail',
'TransDetail'[SYSTEM_NUM]),'TransDetail'[EARN_DEDUCT_IND]=1)
)Regards,
Charlie Liao
- Anonymous8 years agoNot applicable
I am facing the same issue with getting count of measure output. Can you please help in providing the specific solution!
Thanks