Forum Discussion
Count a frequency measure
- 6 years ago
Hi,
since you need frequency on the axis, you need to add a stand-alone table with the neccessary values. And based on those values, count the number of IDs with corresponding frequency.
This measure would look like thisMeasure = VAR _count = COUNTROWS ( FILTER ( ADDCOLUMNS ( VALUES ( 'Table'[id] ); "@freq"; VAR _trans = CALCULATE ( SUM ( 'Table'[transactions] ) ) RETURN IF ( _trans > 3; 4; _trans ) ); [@freq] = SELECTEDVALUE ( Frequency[F] ) ) ) RETURN IF ( ISBLANK ( _count ); 0; _count )Since you have not provided any data or sample report, I have created a mockup dataset and created a demo report based on that dataset: pbix
cheers,
S
Hi,
since you need frequency on the axis, you need to add a stand-alone table with the neccessary values. And based on those values, count the number of IDs with corresponding frequency.
This measure would look like this
Measure =
VAR _count =
COUNTROWS (
FILTER (
ADDCOLUMNS (
VALUES ( 'Table'[id] );
"@freq";
VAR _trans =
CALCULATE ( SUM ( 'Table'[transactions] ) )
RETURN
IF ( _trans > 3; 4; _trans )
);
[@freq] = SELECTEDVALUE ( Frequency[F] )
)
)
RETURN
IF ( ISBLANK ( _count ); 0; _count )Since you have not provided any data or sample report, I have created a mockup dataset and created a demo report based on that dataset: pbix
cheers,
S
- kb45146 years agoFrequent Visitor
Thanks so much! It worked perfectly.