Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a table with many rows, then I want to create a column in this table with random values: Yes, No with a ratio of 80% data for Yes - 20% data for No.
Thank you
To do this you need index field or Incremental date time column
Then you need a new column =
var _sum = sum(Table[Value])
var _cumm = calculate(sum(Table[Value]) , filter(Table, Table[Index]) <= EARLIER(Table[Index]) )
return
if(divide(_cumm,_sum), <=.8,"Yes", "No")
Power Query- Index Column: https://youtu.be/NS4esnCDqVw
Earlier: https://youtu.be/CVW6YwvHHi8
For measure way
Pareto Analysis Again, 80% of sales, Order by Measure when REL position is used: https://youtu.be/GpoITi_tRIw
Your suggestion will return to Yes of 80% first of data. But I want to random value Yes and No with ratio 80% - 20%. Please view below sample
Customer ID | Yes/No |
001 | Yes |
002 | Yes |
003 | No |
004 | Yes |
005 | Yes |
006 | Yes |
007 | No |
008 | Yes |
009 | Yes |
010 | Yes |
You can use random sampling for this. The following links might help:
https://www.linkedin.com/advice/0/what-benefits-drawbacks-using-random-sampling-power
https://chandoo.org/wp/power-query-random-sample/
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
69 | |
35 | |
21 | |
18 | |
15 |
User | Count |
---|---|
126 | |
32 | |
28 | |
24 | |
24 |