Forum Discussion
Create column with random values from list
- 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
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
- Anonymous9 years agoNot applicable
Thanks Angelia - I couldn't get randbetween and lookupvalue to work together in the latest Power BI Desktop version but separating the two into separate columns seems to be a workaround for my issue. Thanks.
- v-huizhn-msft9 years agoMicrosoft Employee
Hi Anonymous ,
I am very happy for you have resolved your issue. You'd better mark the corresponding reply which will help others find the solution easily. Thank you very much.
Best Regards,
Angelia