Forum Discussion
Anonymous
9 years agoNot applicable
Create column with random values from list
Hi all, I want to define a list a text values, and then create a new column which selects any value from that list. Can anyone please tell me how to select any value from a list? e.g. create a new...
- 9 years ago
Anonymous
Please create a Rank column which display the location of text cell.
Rank = RANKX(Table1,Table1[Name],,ASC)
Then, we select any location according the random number between 1 to the max location. Use LOOKUPVALUE function grab the values.New Column = LOOKUPVALUE(Table1[Name],Table1[Rank],RANDBETWEEN(1,MAX(Table1[Rank])))
Please refer to the following screenshot.
Best Regards,
Angelia
Anonymous
9 years agoNot applicable
@smoupre wrote:Number.Random
or
Number.RandomBetween:
Hi, thanks for your reply but I was looking for solutions for text values.
Greg_Deckler
9 years agoCommunity Champion
OK, I guess I thought you'd get where I was going with that. Use the random number to retrieve that item from the list. For example, let's say that your list is has five items in it, and you call it "MyList", you could do something like:
MyList{Number.RandomBetween(0,4)}
List positions start at 0, you can reference a specific list position by using the syntax: Listname{#}