Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FrançoisD
Frequent Visitor

I cannot detect my slicer is a range slicer in JS client API

Hello,

 

I am using the client API to automatically set some values on slicers to help my users and I have an issue with a time range slicer.

The report designer created a range slicer where the default span starts from the minimum date of the full dataset and goes to the maximum, here is a reproduction example:

FranoisD_0-1718781930076.png

When I get the slicer and slicer state in the client API, the only thing I get is :

{
    "filters": [],
    "targets": [
        {
            "table": "races",
            "column": "date"
        }
    ]
}

 

How can I get the fact my slicer is a range slicer so that I can properly set the good operator for state filter?

 

2 REPLIES 2
Anonymous
Not applicable

HI @FrançoisD,

AFAIK, current power bi filters are not able to distinguish between the ‘all selected’ and 'no item selected' effects.(applied 'all select' effect equal to no filter applied) Have you tried to modify the filter ranges to confirm if the client API can respond with these filter effects?

Regards,

Xiaoxin Sheng

Hi, thanks for your answer

Yes, when, the default range is not "full range", the slicer type is easily found thanks to the filters in state.

However I need to automate the selection of the proper elements in the widget so if I cannot guess it is a range slicer my program cannot work. 

 

I understand from your answer there are no way today to get the information about selected widget in the embedded API. Must I raise an Idea somewhere to try having this in the MS roadmap?

Regards

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors