A Shortcode in WordPress is a function or group of functions which can be used to display forms, text, sliders, widgets within page or post content or in sidebar.
By default when a shortcode is created it is not enabled to work in Widgets.
Add following code to your
functions.php file of your Theme to enable it to work in Widgets.
add_filter( 'widget_text', 'shortcode_unautop' );
add_filter( 'widget_text', 'do_shortcode' );