Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Create slicer visual as Dropdown mode in embedded report

Hello, I have an embedded solution where I am adding filters an slicers programatically by using the powerbi-client and power-bi-report-authoring javascript packages. I'm doing this to an embedded report in View mode. I am adding slicers by calling page.createVisual("slicer", { ... layout ... }). That is working correctly to add the slicer, but what I need help with is that those slicers appear in List mode, but I need to change them to view mode.

 

I can't seem to find a property to change or a mechanism to do so. I found another post in the community where people were trying to do that via a custom theme, but it sounds like that doesn't work either (https://community.powerbi.com/t5/Desktop/PowerBI-JSON-Theme-Slicer-Default-Mode-to-Dropdown/m-p/827843).

 

Can you help me understand how to programatically set slicer mode to Dropdown in an embedded report?

3 Replies

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Anonymous ,

     

    The easiest way is to create a slicer with a drop-down menu directly in PBI Desktop, and then embed the report into your own application.

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for the response. However, that doesn't help me in my situation. I really need to be able to create one or more slicers at runtime through the embedded solution. Adding one beforehand doesn't help me.

  • VincentLai's avatar
    VincentLai
    Frequent Visitor

    Are you able to find the solution at the end? Appreaciate that you can share it if any solution found