Randomizer through power query or as a measure

%3CLINGO-SUB%20id%3D%22lingo-sub-1585754%22%20slang%3D%22en-US%22%3ERandomizer%20through%20power%20query%20or%20as%20a%20measure%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1585754%22%20slang%3D%22en-US%22%3EHello%2C%3CBR%20%2F%3EI%E2%80%99m%20fairly%20new%20to%20power%20query%2C%20but%20I%E2%80%99ve%20been%20tasked%20with%20a%20project%20that%20I%20can%E2%80%99t%20seem%20to%20find%20a%20good%20solution%20for.%3CBR%20%2F%3E%3CBR%20%2F%3EBasically%2C%20I%20have%20a%20data%20set%20that%20has%20a%20column%20with%20an%20employee%20name%20and%20a%20column%20with%20a%20sales%20ID%20(a%20unique%20number).%20I%20need%20to%20create%20a%20tool%20that%20will%20generate%20a%20table%20from%20this%20data%20that%20populates%20a%20random%20number%20of%20sales%20ids%20for%20every%20employee%20listed.%20(Or%20worst%20case%2C%20all%20sales%20ids%20per%20employee%2C%20but%20in%20a%20random%20order%2C%20however%20the%20preference%20given%20to%20me%20was%202-3%20sales%20per%20employee)%3CBR%20%2F%3E%3CBR%20%2F%3EI%20initially%20created%20a%20query%20with%20a%20connection%20to%20this%20data%20set%20(so%20multiple%20people%20can%20create%20a%20copy%20of%20the%20file%20and%20have%20access%20to%20the%20refreshed%20information)%20Then%20I%20made%20random%20column%20and%20a%20index%20column%20(which%20a%20buffer%20step%20to%20prevent%20duplicate%20random%20numbers)%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20problem%20is%20that%20when%20I%20did%20this%2C%20it%20either%20shows%20only%20one%20sale%20per%20employee%2C%20or%20it%20shows%20all%20sales%20from%20that%20employee%20in%20the%20same%20order%20every%20time.%20The%20all%20sales%20thing%20wouldn%E2%80%99t%20be%20an%20issue%2C%20but%20I%20need%20it%20to%20work%20in%20a%20way%20that%20when%20the%20user%20refreshes%20the%20sales%20ID%20order%20refreshes%2C%20even%20if%20the%20data%20set%20is%20the%20same%20(mainly%20just%20the%20order%20of%20the%20sales%20ids%20needs%20to%20be%20different)%20because%20the%20data%20set%20is%20a%20running%20file%2C%20so%20once%20a%20sales%20ID%20is%20on%20there%20it%20stays%20on%20there.%3CBR%20%2F%3EI%E2%80%99m%20not%20sure%20if%20a%20column%20in%20power%20query%20is%20the%20best%20response%20or%20if%20I%E2%80%99m%20better%20off%20using%20a%20dax%20measure%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20in%20advance!%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1585754%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20BI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Visitor
Hello,
I’m fairly new to power query, but I’ve been tasked with a project that I can’t seem to find a good solution for.

Basically, I have a data set that has a column with an employee name and a column with a sales ID (a unique number). I need to create a tool that will generate a table from this data that populates a random number of sales ids for every employee listed. (Or worst case, all sales ids per employee, but in a random order, however the preference given to me was 2-3 sales per employee)

I initially created a query with a connection to this data set (so multiple people can create a copy of the file and have access to the refreshed information) Then I made random column and a index column (which a buffer step to prevent duplicate random numbers)

The problem is that when I did this, it either shows only one sale per employee, or it shows all sales from that employee in the same order every time. The all sales thing wouldn’t be an issue, but I need it to work in a way that when the user refreshes the sales ID order refreshes, even if the data set is the same (mainly just the order of the sales ids needs to be different) because the data set is a running file, so once a sales ID is on there it stays on there.
I’m not sure if a column in power query is the best response or if I’m better off using a dax measure?

Thank you in advance!
0 Replies