Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I'm trying to create a measure that will randomly assign people in my file to a treatment group or a control group if their score is above a threshold. I've found the RAND command will generate a random number so I was thinking I could do a two step to assign groups.
Hi @ahumke ,
You can try this
Random Assignment =
IF (
'Tuesday, July 7, 2020'[Weighted Average Score] > 3,
DIVIDE (
'Tuesday, July 7, 2020'[Weighted Average Score],
100
) * ( 2 - 1 ) + 1
)
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
@ahumke , Random function changes values with every load. You need to find a better way.
Maybe create a RANk and divide my max Rank +1
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
Consider using List.Random inside of Power Query. It will only update on the refresh of the dataset, not as users are working in the report. Here is an article that shows how to do that.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCheck out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
101 | |
98 | |
97 | |
38 | |
37 |
User | Count |
---|---|
152 | |
121 | |
73 | |
71 | |
63 |