add_slicer
add_slicer(
data_source,
column_name,
dashboard_path,
page_id,
slicer_id,
height,
width,
x_position,
y_position,=6000,
z_position=-1001,
tab_order=None,
title='left',
text_align='bold',
font_weight=32,
font_size='#000000',
font_color=None,
background_color=None,
parent_group_id )
Add a slicer to a page
:param str data_source: This is the name of the dataset that you want to use to populate the slicer with :param str column_name: This is the name of the measure (or variable) name you want to use to populate the slicer with :param str dashboard_path: The path where the dashboard files are stored. (This is the top level directory containing the .pbip file and Report and SemanticModel folders). :param str page_id: The unique id for the page you want to add the slicer to. If you used this package’s functions it will be in the format page1, page2, page3, page4, etc. If you manually created the page it will be a randomly generated UUID. To find a page’s page id, consult the report > definition> pages > page.json file and look in the page order list. :param str slicer_id: Please choose a unique id to use to identify the slicer. PBI defaults to using a UUID, but it’d probably be easier if you choose your own id.
:param int height: Height of slicer on the page :param int width: Width of slicer on the page
:param int x_position: The x coordinate of where you want to put the slicer on the page. Origin is page’s top left corner. :param int y_position: The y coordinate of where you want to put the slicer on the page. Origin is page’s top left corner. :param int z_position: The z index for the visual. (Larger number means more to the front, smaller number means more to the back). Defaults to 6000 :param int tab_order: The order which the screen reader reads different elements on the page. Defaults to -1001 for now. (I need to do more to figure out what the numbers correpond to. It should also be possible to create a function to automatically order this left to right top to bottom by looping through all the visuals on a page and comparing their x and y positions)
:param str title: An optional title to add to the slicer. :param str text_align: How would you like the text aligned (available options: “left”, “right”, “center”) :param str font_weight: This is an option to change the font’s weight. Defaults to bold. Available options include: [“bold”] :param int font_size: The font size in pts. Must be a whole integer. Defaults to 32 pt :param str font_color: Hex code for the font color you’d like to use. Defaults to black (#000000) :param str background_color: Hex code for the background color of the slicer. Defaults to None (transparent) :param str parent_group_id: This should be a valid id code for another power BI visual. If supplied the current visual will be nested inside the parent group.
This function creates a new slicer on a page.