Forum Discussion
Percentile table like Excel
- 8 years ago
McCow Thanks for explination, I have tried to follow the same steps for prod data and there seems to be issue.
Could you point out what I am doing wrong please? Here's the updated pbi file: https://1drv.ms/u/s!Aghc93erq8rBcUhH5N_y1X_MXN8
I have created 3 new tables exactly in the same structure:
size_prod, stats_prod, Persentille_prod
Thanks again for your time, patience. I am learning alot from you!Kind Regards
Hi Greg_Deckler,
The final result I am looking to achieve is like this:
Table 1
| Date | ID | Sales | Cost |
| 01/01/2017 | 40505 | 114 | 357 |
| 02/01/2017 | 72878 | 901 | 416 |
| 03/01/2017 | 36370 | 463 | 3810 |
| 04/01/2017 | 41006 | 740 | 2805 |
| 05/01/2017 | 57904 | 987 | 3220 |
| 06/01/2017 | 45632 | 157 | 2348 |
| 07/01/2017 | 33843 | 856 | 2135 |
| 08/01/2017 | 71400 | 537 | 2159 |
| 09/01/2017 | 74717 | 289 | 1483 |
| 10/01/2017 | 77747 | 973 | 1922 |
| 11/01/2017 | 60239 | 830 | 2107 |
| 12/01/2017 | 65054 | 633 | 3405 |
| 13/01/2017 | 44939 | 326 | 1584 |
| 14/01/2017 | 71789 | 655 | 1328 |
| 15/01/2017 | 40704 | 558 | 3636 |
| 16/01/2017 | 68804 | 668 | 3165 |
| 17/01/2017 | 41137 | 99 | 138 |
| 18/01/2017 | 47474 | 759 | 516 |
| 19/01/2017 | 46244 | 748 | 1534 |
| 20/01/2017 | 26707 | 797 | 3943 |
| 21/01/2017 | 45512 | 427 | 1924 |
| 22/01/2017 | 74276 | 639 | 2995 |
| 23/01/2017 | 75824 | 605 | 390 |
| 24/01/2017 | 47363 | 495 | 3676 |
| 25/01/2017 | 72470 | 685 | 3021 |
| 26/01/2017 | 48808 | 94 | 2736 |
| 27/01/2017 | 32450 | 66 | 1238 |
| 28/01/2017 | 48837 | 213 | 921 |
| 29/01/2017 | 46723 | 857 | 378 |
| 30/01/2017 | 56503 | 776 | 2414 |
| 31/01/2017 | 50555 | 530 | 3044 |
Table 2
| ID | Size |
| 40505 | 980 |
| 72878 | 7600 |
| 36370 | 420 |
| 41006 | 19000 |
| 57904 | 2100 |
| 45632 | 610 |
| 33843 | 2600 |
| 71400 | 420 |
| 23441 | 150 |
| 23471 | 5800 |
| 23478 | 4500 |
| 23488 | 3100 |
| 23554 | 800 |
| 23568 | 12000 |
| 23576 | 950 |
| 23586 | 2100 |
| 23607 | 7300 |
| 23662 | 90 |
| 23678 | 200 |
| 23702 | 1200 |
| 23715 | 5500 |
| 23751 | 430 |
| 23764 | 2900 |
| 23941 | 3800 |
| 24013 | 520 |
| 24224 | 620 |
| 24227 | 11000 |
| 24244 | 1800 |
| 24318 | 960 |
| 24333 | 120000 |
| 24334 | 370 |
| 24456 | 530 |
| 24487 | 2500 |
| 24498 | 410 |
Relationship is on ID columns.
Thanks for your time.
Kind Regards.
I have done some research and found out that this is the dax I need to use to calculate percentile but not sure how to adapt it for each percentile group: = PERCENTILEX.INC(<table>, <expression>;, k)
Does anyone know how I can have a dynamic value for "k"?
Thanks
- McCow8 years agoResolver III
Hi micky123,
to build a column like your example, you can create DAX table (for ex. PersentilleT):
PersentilleT = UNION(GENERATESERIES(0;0,05;0,01);GENERATESERIES(0,1;0,9;0,05);GENERATESERIES(0,91;1;0,01))
Now you have one-column table with "Value" column.
And as second calculated column you can use this formula:Column = PERCENTILEX.INC(Table1;Table1[Cost];[Value])
It's all as you need?
P.S. for dynamic k-value you need to build a measure. It' is a little complicated approach.
Best Regs
- micky1238 years agoFrequent Visitor
McCow Thanks this was helpful and I think I am getting close to what I am trying to do.
I am unable to get this work
Column = PERCENTILEX.INC(Table1;Table1[Cost];[Value])
I have created a sample PowerBI file using your suggestion. URL: https://1drv.ms/u/s!Aghc93erq8rBcLygGX6qE2p7zXY
Please let me know if this simplify what I am after.
Thanks
- McCow8 years agoResolver III
Hi micky123
good job, you was a pretty near.
i corrected you PBIX example and send back, LOOK HERE:
Two remarks:
1) The percentile calculation must be a column, not measure (see above)
2) The source Data type must be "Decimal" not Whole (see bellow):
And i added extra columns for better understanding you troubles. It can be leaved to better understanding, what i did. Enjoy!
If you have a questions ask back.
Best regs