Forum Discussion
Anonymous
7 years agoNot applicable
First N rows
Hi, I have a table with some clients and i want to reduce that table in order to get a random 10% sample of clients. How can I do it? (It must be in DAX) Thanks!
- 7 years ago
Hi Anonymous,
You can write something like either of these expressions (assuming your original table is called Clients):
Client Sample = SAMPLE ( 10, ADDCOLUMNS ( Clients, "rand", RAND () ), [rand] ) Client Sample = TOPN ( 10, ADDCOLUMNS ( Clients, "rand", RAND () ), [rand] )
Both of these add a column [rand] to the resulting table, which could be removed with SELECTCOLUMNS if needed.
Regards,
Owen
Anonymous
7 years agoNot applicable
Solved! Thanks for your consideration.
Cheers!
ARAM
4 years agoRegular Visitor
What was the solve? was it the solution noted above? Thank you.