Forum Discussion
Count Multiple Cell Values and Without Counting Blank Cell
- 4 years ago
Hi nosirui54
If you need a column use this code:
Column = CALCULATE ( COUNT ( 'Table'[Months] ) + COUNT ( 'Table'[Year] ) + COUNT ( 'Table'[Number] ) + COUNT ( 'Table'[FIPS] ) + COUNTA ( 'Table'[Postal_Code] ) + COUNT ( 'Table'[State] ) + COUNT ( 'Table'[County] ), FILTER ( 'Table', 'Table'[Months] = EARLIER ( 'Table'[Months] ) ) )Output:
If you need a measure:
Measure = CALCULATE ( COUNT ( 'Table'[Months] ) + COUNT ( 'Table'[Year] ) + COUNT ( 'Table'[Number] ) + COUNT ( 'Table'[FIPS] ) + COUNTA ( 'Table'[Postal_Code] ) + COUNT ( 'Table'[State] ) + COUNT ( 'Table'[County] ), FILTER ( 'Table', 'Table'[Months] = max ( 'Table'[Months] ) ) )Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi nosirui54
If you need a column use this code:
Column =
CALCULATE (
COUNT ( 'Table'[Months] ) + COUNT ( 'Table'[Year] )
+ COUNT ( 'Table'[Number] )
+ COUNT ( 'Table'[FIPS] )
+ COUNTA ( 'Table'[Postal_Code] )
+ COUNT ( 'Table'[State] )
+ COUNT ( 'Table'[County] ),
FILTER ( 'Table', 'Table'[Months] = EARLIER ( 'Table'[Months] ) )
)
Output:
If you need a measure:
Measure =
CALCULATE (
COUNT ( 'Table'[Months] ) + COUNT ( 'Table'[Year] )
+ COUNT ( 'Table'[Number] )
+ COUNT ( 'Table'[FIPS] )
+ COUNTA ( 'Table'[Postal_Code] )
+ COUNT ( 'Table'[State] )
+ COUNT ( 'Table'[County] ),
FILTER ( 'Table', 'Table'[Months] = max ( 'Table'[Months] ) )
)
Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Its Work. Thank you SO much for the Solutions.
Please is there a way to avoid the Filters? because some of the Columns i will be filtreing with does not have Value.
- VahidDM4 years agoSuper User
No Worries.
Can you please tell me more or share a sample re that Filter issue?
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/- nosirui544 years agoHelper I
Thank you for your time. What am trying to say is that what if the colomn does not have Calendar and am trying to achieve the same result as shown below: Thank you
Number FIPS Postal_Code State County Expected_Output_Counts 1 1000 36003 Alabama Autauga 5 2 1001 36003 Alabama Autauga 5 3 31034 Alabama Baldwin 4 1005 26238 Alabama Barbour 4 5 1007 Texas Valley 4 6 Indinana Marion 3 7 1011 2 1011 Texas 2