Forum Discussion

pk3130's avatar
pk3130
Regular Visitor
1 year ago
Solved

Power BI dynamic visualizations

We have a predefined list of columns (e.g., Col1 to Col50) from which users can select multiple columns. The report includes 10 table visualizations, and each one should display data from one of the selected columns.

If the user selects more than 10 columns, only the first 10 selected columns should be used — each column should be mapped automatically to one of the 10 table visualizations.

Example:
If the user selects 15 columns out of the available 50, only the first 10 selected columns will be displayed across the 10 table visuals, with each table showing one selected column.

 

Approach followed : Used parameter slicer to select the column list where user can select multiple columns. Able to get the first 10 selected columns using the measure but unable to map columns dynamically to the tabular visualizations

  • Power BI cannot work with encrypted Excel files.

     

    Confidential - Microsoft Extended:DESCRIPTION Data is classified and protected. Microsoft Full Time Employees (FTE) and non-employees can edit, reply, forward and print. Recipient can unprotect content with the right justification.

18 Replies

  • pk3130's avatar
    pk3130
    Regular Visitor

    lbendlin 

     

    Input1-MainTable :

     

    col1col2col3
    aa1a2
    aa1b2
    ab1c2
    bb1d2
    bc1e2
    bc1d2


    input2-UserselectedColumns :

    ColumnName
    col1
    col2

     

     Viz1    Viz2
    Col1Count   Col2Count
    a3   a12
    b3   b12
         c12
    • HarishKM's avatar
      HarishKM
      Super User

      pk3130 Hey,
      I will follow below method as per your latest input.
      1) Make sure you have a parameter table that lists all columns

      2) Use the UserselectedColumns[ColumnName] to create a slicer where users can select multiple columns.
      3)  Create measures for dynamic counting based on selected columns.

       Col1Count =
      VAR SelectedCol1 = SELECTEDVALUE(UserselectedColumns[ColumnName], "col1")
      RETURN
      CALCULATE( COUNT(MainTable[ColumnName]), MainTable[True] = TRUE() )

      4) Ensure each table visual dynamically interacts with the selected column measure.

      5) Use columns col1 and colcount1 for your first table visual.
      follow by rest column


      Thanks
      Harish KM

      If these steps help resolve your issue, your acknowledgment would be greatly appreciated.

       
      • pk3130's avatar
        pk3130
        Regular Visitor

        Thanks HarishKM ,

         

        I see one issue with above solution lets say for first viz we selected col1 but what if customer didn't select col1 itself. Then still we will be showing the data of col1 which is not expected

  • You might be better off using Small Multiples visuals, and Field Parameters for your columns to be used as the legend field.

  • pk3130's avatar
    pk3130
    Regular Visitor

    We have a predefined list of columns (e.g., Col1 to Col50) from which users can select multiple columns. The report includes 10 table visualizations, and each one should display data from one of the selected columns.

    If the user selects more than 10 columns, only the first 10 selected columns should be used — each mapped automatically to one of the 10 table visualizations.

    Example:
    If the user selects 15 columns out of the available 50, only the first 10 selected columns will be displayed across the 10 table visuals, with each table showing one selected column.

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

    Hi pk3130,

    Thank you for reaching out to the Microsoft fabric community forum.  I reproduced the scenario again, and it worked on my end. I used my sample data and successfully implemented it.

    Outcome:


    For other tables also you can follow same like this mentioned in the .pbix file. I am also including .pbix file for your better understanding, please have a look into it:

    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 for using Microsoft Community Forum.

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

      Hi pk3130,

      Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.

      Thank you!

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

        Hi pk3130,

        Hope you had a chance to try out the solution shared earlier. Let us know if anything needs further clarification or if there's an update from your side always here to help.

        Thank you.