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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
eramirez
Frequent Visitor

Custom Data Connector - Filter Selector

Hi,

 

I'm building a Custom Data Connector for Power BI, and I want to have two selectors and one to be affected for the first selection, like Select Country and then City.

 

Right now I have a restul service that when I send a country it returns all the cities from that country, How can I achieve calling the service with an on change or some event of the selector.

 

Here is my code where I Create the selectors:

 

 

//Set AllowedValues on each parameter
AddAllowedValues =
let
    AvailableCountries = getDataFromUrl,
    AvailableCities = {},
    CountryParamType = type text 
                      meta [Documentation.AllowedValues = AvailableCountries],
    CityParamType = type text 
                      meta [Documentation.AllowedValues = AvailableCities],
    NewFunctionType = type function (
                       Select as CountryParamType,
                       Select2 as CityParamType2) 
                       as table,
    CastToType = Value.ReplaceType(BaseFunction, NewFunctionType)
in
    CastToType
 
in
    AddAllowedValues;

 

I hope you can help me

 

Regards

 

1 REPLY 1
KumarDarmesh
Helper IV
Helper IV

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.