A random variable does not need to be a scalar. It can be a vector, a matrix, etc. as long as it comes from a (measurable) set of outcomes.
In the case you are asking, the random variable is the dataset itself, coming from the family of all possible datasets. Its distribution is derived from the distribution that generates each

.
Hope that this helps.