Forum Discussion
Count a Measure or Countif
Hi Corleen,
Usually you can use below in counting reference to a column
CALCULATE (
COUNTROWS ( 'TableName' ),
ALLEXCEPT (
'TableName',
'TableName'[Coulmn_you_want_to_count],
'TableName'[Reference_Coulmn],
)
)
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)
where
[# times] = CALCULATE(COUNT('TransDetail'[SYSTEM_NUM]),'TransDetail'[EARN_DEDUCT_IND]=1)
Thanks
- Amratya9 years agoAdvocate I
I think if you gave this a try you will have all you need in one column
#times = CALCULATE(COUNTROWS('TransDetail'),ALLEXCEPT('TransDetail','TransDetail'[SYSTEM_NUM],'TableName'[EARN_DEDUCT_IND],))
It will count all trnx that have EARN_DEDUCT_IND = 1, 2, 3, ...etc and place it in one column