Forum Discussion
Percentile.INC for categories and dates dynamically
Hello,
This is my first time I am asking for help in this community, so please accept my apology if I forgot to include anything crucial to solve the problem, of course I will do it later if necessary.
I looked here for my problem but I did not find any solution which might fulfill the needs.
Recently I have been asked to create a report which will show percentile.inc on the line and clustered column chart. The problem is that my data contains some values based on which the measure is created (Measure = DIVIDE(CALCULATE(SUM('table2'[Cases])) * 200000,CALCULATE(SUM('table2'[Hours]))), and moreover each plant exists in the database per date (one row for one date - monthly basis). The request is to being able to filter dataframe (for instance 6 months only or just 1) and check what is the percentile per plant complexity or total and show it on the chart as a line (finally it will be 4 measures showing four different percentiles) and X-Axis by plant. I have two tables, one with plant masterdata and one with the data per plant. PERCENTILE.INC doesn't accept measure as a first argument which have to be column. I cannot store the indicated measure as a column because it needs to be calculated as mentioned (cannot be the average).
Usually the solution that I found on net is to create another table with summarized data but I do not want to do that as I want to be able to filter the dates.
This is table1 which contains plant masterdata.
| Region | Plant | Plant Complexity |
| C | C | M |
| E | G | M |
| I | H | L |
| N | K | H |
| I | P | L |
| I | S | H |
This is table2 which contains data per plant:
| Date | Hours | Cases | Plant |
| 01.01.2022 | 231925 | 0 | C |
| 01.01.2022 | 87595 | 0 | G |
| 01.01.2022 | 400 | 0 | H |
| 01.01.2022 | 126500 | 0 | K |
| 01.01.2022 | 52512 | 0 | P |
| 01.01.2022 | 91532 | 1 | S |
| 01.02.2022 | 183074 | 0 | C |
| 01.02.2022 | 105633 | 0 | G |
| 01.02.2022 | 400 | 0 | H |
| 01.02.2022 | 126000 | 0 | K |
| 01.02.2022 | 51936 | 0 | P |
| 01.02.2022 | 82770 | 1 | S |
| 01.03.2022 | 133945 | 0 | C |
| 01.03.2022 | 116312 | 0 | G |
| 01.03.2022 | 720 | 0 | H |
| 01.03.2022 | 126000 | 1 | K |
| 01.03.2022 | 58860 | 0 | P |
| 01.03.2022 | 89961 | 0 | S |
Many thanks for any help in advance, for anything more please let me know and I will provide.
thank you!
2 Replies
- AnonymousNot applicable
Hi krzysztof_golda ,
According to your statement, I think your requirement is not very clear. I think two tables should be related by [Plant] column.
Measure = DIVIDE(CALCULATE(SUM('table2'[Cases])) * 200000,CALCULATE(SUM('table2'[Hours])))This measure should work to calculate the percentage. Please show me a screenshot with the result you want. This will make me easier to find the solution.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- krzysztof_goldaFrequent Visitor
Hi Anonymous ,
Many thanks for the reply, appreciate it,
So let me explain, the request is to create 4 measures which will show accordingly 25th, 50th, 75th and 90th percentile. Each plant have its complexity, and also we have a timeline filter, so the aim is to filter by time and the complexity. For instance: when I choose last 6 months and no complexity then measure should calculate 25th percentile for whole organisation for last 6 months, but when I choose last 6 months AND the complexity low, I should see what is the 25th percentile for those plants which are low. The percentile measures will be put into the column chart and line chart (percentiles as lines, the value should be constant across the company and related to filters of complexity and timeline). Important thing is that if only one plant is chosen, the measure should calculate percentile only to the level of complexity, not plant.
Currently I am using the percentile from the analysis tab of the visual, but when plant is chosen, it shows the percentile for this certain plant and not for the complexity.
This should look like below, where in the X-Axis we have plants and the Y-Axis is the mentioned calculation:
Measure = DIVIDE(CALCULATE(SUM('table2'[Cases])) * 200000,CALCULATE(SUM('table2'[Hours])))If anything more is necessary let me know,
Greetings!