Forum Discussion
Creating dynamic Load Duration Curves, dynamic sorting of linechart from largest to smallest y-value
Hi Anonymous
Thanks for your reply, much appriciated.
My specific result: I need make LDC curves of various values (first of for 'Percent_REofConsumption') across variable timespans (chosen by the slicer linked to 'HourDK') with a value for each hour.
The LDC chart (could be line or bar chart) must be sorted acording to the values with the largest first and the lowest at the end. In the LDC chart the x-axis i represented as 0-100% and the values are evenly distribted across the axis no matter the chosen timepan (selected in the slicer).
Simple example below:
Full dataset, raw:
Hour | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
Value | 4 | 7 | 2 | 3 | 9 | 10 | 22 | 24 | 26 | 18 | 17 | 13 | 11 | 12 | 14 | 15 | 8 | 6 | 5 | 1 |
Normal line chart on full data:
Full dataset (hour 1-20), for LDC curve (hours in percent and values sorted):
% | 5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 |
Value | 26 | 24 | 22 | 18 | 17 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
LDC chart for full data:
Selected dataset (only hour 1-10), for LDC curve (hours in percent and values sorted):
% | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 |
Value | 26 | 24 | 22 | 18 | 10 | 9 | 7 | 4 | 3 | 2 |
LDC chart for selected data (hour 1-10):
I hope this clarifies. Please let me know if more information in needed, and for easy test kindly try with the data provided in my first post.
Best regards,
Niels
Hi Anonymous ,
Below is my table:
I create two column:
* Rank = RANKX(ALL('Table'), 'Table'[ue], , DESC, DENSE)
* Percentage = DIVIDE('Table'[* Rank], COUNTROWS(ALL('Table')))
The final output is shown in the following figure:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years agoNot applicable
Hi Anonymous ,
Thank you very much for your time and support.
Unfortunately, when I try to replicate your approach I am still left with the problem that the LDC datapoints are not equally distributed across the x-axis.
I have made an identical copy of your approach, but I cannot get the same equal distance on the x-axis. -I also cannot change the x-axis to % in the "Visual" menu.
Please see attached screenshot of the problems here:
What do you suggest?
Best regards,
Niels
- Anonymous2 years agoNot applicable
Hi Anonymous ,
Try to change the x-axis type to Categorical to get the same equal distance.I placed the percentage calculation column directly on the x-axis.
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years agoNot applicable
Hi Anonymous ,
Thanks for your swift reply.
Setting the x-axis type to Catagorical is not an option, it needs to be Continuous. Otherwise a horizontal scrolling-bar will apear for larger data sets. My actual data set must be able to show several thousands datapoints at once in the chart without the need to scroll back and forth..
Do you know how to fix it?
I got the percentage working by setting the data type for the column to "percentage" in the Table View.
Thanks,
Br Niels