Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello guys
i have productivity table for all users as below
and i create calculated measure 3% like "sample = COUNT(productivity_table[ID No])*0.03" by username
I want to create output random table based on total sample ( 3% of productivity ) by username like ;
username "nadyan" must have '2' (Based on sample 3% column in total sample table) random sample case,
so i want to get only 2 row data in Productivity table wich handled by nadyan
so are "fiegata" and any other user
FYI, my connection is on "Directquery" mode to SQL,
i tried to used "Rand()" and "Sample()" for this case but the results are not as expected.
Please can you help me to solve this.
Thank you
Regards
Solved! Go to Solution.
Hi @Anonymous ,
I created the data:
Here are the steps you can follow:
1. Create measure.
Count_measure = COUNTX(FILTER(ALL('Table'),MAX('Table'[Username])='Table'[Username]&&'Table'[ID NO]>MAX('Table'[ID NO])),'Table'[Gen ID])
Result =
IF(MAX('Table'[Sample])>=[Count_measure]&&NOT(ISBLANK([Count_measure])),1,0)
Result:
2. Place Measure[Result] in Filter, set is =1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I created the data:
Here are the steps you can follow:
1. Create measure.
Count_measure = COUNTX(FILTER(ALL('Table'),MAX('Table'[Username])='Table'[Username]&&'Table'[ID NO]>MAX('Table'[ID NO])),'Table'[Gen ID])
Result =
IF(MAX('Table'[Sample])>=[Count_measure]&&NOT(ISBLANK([Count_measure])),1,0)
Result:
2. Place Measure[Result] in Filter, set is =1, apply filter.
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
I created the data:
Here are the steps you can follow:
1. Create calculated column.
Column = COUNTX(FILTER('Table',EARLIER('Table'[Username])='Table'[Username]&&'Table'[ID NO]>EARLIER('Table'[ID NO])),'Table'[Gen ID])
2. Create calculated table.
Table 2 =
FILTER('Table','Table'[Sample]>='Table'[Column]&&NOT(ISBLANK('Table'[Column])))
3. Result.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Need help
thanks for your help, but ican't follow this step
1. Create calculated column.
there is no Countx Option, probably its because im using "direct query" mode in connection.
is there any other way to solve it.
thank you
@Anonymous , the expected output is not clear. Can you explain that with an example
Hi @amitchandak
reffering to "total sample" table, the example like this ;
username "nadyan" must have '2' (Based on sample 3% column in total sample table) random sample case,
so i want to get only 2 row data in Productivity table which handled by nadyan
so are "fiegata" and any other user,
Thanks for your help.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |