Forum Discussion
mkwiatkowski
4 years agoFrequent Visitor
Count rows based on column which is a measure
I'm trying to create a count of rows based off a column which is a measure. So in screenshot example below i have a column called 'data_field' and another called 'PercentageCoverage' which is a mea...
- 4 years ago
Set up a new table, e.g. Segments, which contains the min and max values for the range and the text you want to display. Then you can create a new measure
Num in segment = SUMX ( Segment, COUNTROWS ( FILTER ( 'Table', [PercentCoverage] >= Segments[Min value] && [PercentCoverage] < Segments[Max value] ) ) )
johnt75
4 years agoSuper User
Can each entry in data_field appear more than once? If so then you can replace the 'coverage_metrics' line with VALUES('coverage_metrics'[data_field]) and that will then only work on the unique values rather than counting duplicates
mkwiatkowski
4 years agoFrequent Visitor
Brilliant! That fixed it. Thank you so much for your help 🙂