Forum Discussion

VietTran123's avatar
VietTran123
New Member
1 year ago
Solved

[Custom Connector] How to implement checkbox?

Hi guys,

I want to create checkbox like this

But in the Document, there is no option to define check box.

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi VietTran123,

     

    Thanks for reaching out to the Microsoft fabric community forum and  your interest in creating a checkbox-like functionality within your Power BI custom connector. While Power BI doesn't support checkboxes natively in the connector interface.

    There are several effective methods and workarounds to achieve similar functionality. Here’s how you can implement it:

     

    You can write custom SQL queries in your connector to filter data based on user selections. While this doesn't create a physical checkbox, you can simulate checkbox behavior through option selection:

    • Use a parameter that allows you to select multiple options. In your SQL query, filter data based on these selections.

    Example Query:

    SELECT * FROM YourTable WHERE YourColumn IN ('Option 1', 'Option 2');

    Once the data is retrieved based on user input, you can further manipulate it:

    • Create DAX measures or calculated columns that aggregate data according to the options chosen. This will allow your reports to dynamically respond based on input.

    Query folding optimizes performance by executing queries at the database level rather than pulling unnecessary data into Power BI:

    • Make sure your custom connector supports query folding. This means structuring your connector queries to utilize your selections effectively, ensuring efficient data retrieval.

    Utilizing the M language gives you control over how data is transformed before it is loaded into Power BI:

    • You can shape and filter data using M based on the selected parameters. For instance, if you select certain options, you can adjust the dataset loading accordingly.

    By combining these methods, you can effectively create a functionality that create checkboxes. You will be able to select options, and the connector will respond dynamically, retrieving and filtering data accordingly.

     

    For your additional information please refer to the below links:

    https://community.fabric.microsoft.com/t5/Power-Query/custom-connector/td-p/3195689

    https://community.fabric.microsoft.com/t5/Desktop/ODBC-Custom-Connector-Dialect/m-p/4108773

     

    I hope my suggestions give you good ideas, if you need any further assistance, feel free to reach out.

     

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

     

    Thank you.

     

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi VietTran123,

     

    Thanks for reaching out to the Microsoft fabric community forum and  your interest in creating a checkbox-like functionality within your Power BI custom connector. While Power BI doesn't support checkboxes natively in the connector interface.

    There are several effective methods and workarounds to achieve similar functionality. Here’s how you can implement it:

     

    You can write custom SQL queries in your connector to filter data based on user selections. While this doesn't create a physical checkbox, you can simulate checkbox behavior through option selection:

    • Use a parameter that allows you to select multiple options. In your SQL query, filter data based on these selections.

    Example Query:

    SELECT * FROM YourTable WHERE YourColumn IN ('Option 1', 'Option 2');

    Once the data is retrieved based on user input, you can further manipulate it:

    • Create DAX measures or calculated columns that aggregate data according to the options chosen. This will allow your reports to dynamically respond based on input.

    Query folding optimizes performance by executing queries at the database level rather than pulling unnecessary data into Power BI:

    • Make sure your custom connector supports query folding. This means structuring your connector queries to utilize your selections effectively, ensuring efficient data retrieval.

    Utilizing the M language gives you control over how data is transformed before it is loaded into Power BI:

    • You can shape and filter data using M based on the selected parameters. For instance, if you select certain options, you can adjust the dataset loading accordingly.

    By combining these methods, you can effectively create a functionality that create checkboxes. You will be able to select options, and the connector will respond dynamically, retrieving and filtering data accordingly.

     

    For your additional information please refer to the below links:

    https://community.fabric.microsoft.com/t5/Power-Query/custom-connector/td-p/3195689

    https://community.fabric.microsoft.com/t5/Desktop/ODBC-Custom-Connector-Dialect/m-p/4108773

     

    I hope my suggestions give you good ideas, if you need any further assistance, feel free to reach out.

     

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

     

    Thank you.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi VietTran123

      I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


      Thank you.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hello VietTran123 ,

         

        I wanted to follow up on our previous suggestions regarding [Custom Connector]. We would love to hear back from you to ensure we can assist you further.

        If my response has addressed your query, please accept it as a solution and give a ‘Kudos’ so other members can easily find it. Please let us know if there’s anything else we can do to help.

         

        Thank you.

  • To implement a checkbox in a custom connector, you can use a Boolean parameter in the function definition. While the documentation might not explicitly mention "checkbox," a Boolean parameter renders as a checkbox in the UI.

    Example Implementation:

     

    Documentation.AllowedValues = {
    [Documentation.FieldCaption = "Enable Feature",
    Documentation.FieldDescription = "Check this box to enable the feature.",
    Type = type logical]
    }