I would like to have my custom plugin on top of the sidebar. Haven't found how the order is made. Now my custom plugin is at the bottom. I would like to move it near the top.
You can choose the menu position with add_menu_page() like this:
add_menu_page(
__( 'Custom Menu Title', 'textdomain' ),
'custom menu',
'manage_options',
'custompage',
'my_custom_menu_page',
plugins_url( 'myplugin/images/icon.png' ),
6 //choose your Position!!!!
);
These are the default values for "position":
In your case, if you type 0 or 1 in the position field your custom menu will be displayed at the top of the "Dashboard" menu.