count( {< [A]= {"=Rank(count([B]))/count(distinct total {1}[A])<=0.2"} >} [B] )
"A" is a column that lists several customer names. "B" lists how many so called errors we had in total. The dimension of the table is the customer Name ("A") so that each customer gets linked to his errors. I now just want to display the top 20% of the customers in terms of how many errors we have had with them.
With the given formula something in my table gets cut. The total number of errors shrinks from 238K to 220K. Still the number of customers stays the same and all are displayed. As I said I just want the 20% of customers with the most errors.
Table1:
Load
*,
RowNo() as RowNo
Load
A,
B
From Source
Order by B
;
Table2:
Load
Count(B) as CountRows
Resident Table1;
let vCountRows = Peek('CountRows',0,[Table2]);
FinalTable:
Load
*
Resident Table1
Where RowNo <= ($(vCountRows) * 0,2)
drop Table1;
drop Table2;