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
Anonymous
Not applicable

Dynamic data collection from existed tables based on slicer selection

Dear all,

I am having a table which has the structure like this one:

NghiaPLT_1-1674039914209.png

I want to create a slicer which indicates the column names for the data aggregation.

For example, if I choose the "Age" from the slicer, the data will just select the first three-column and the AGE_GROUP column from the table. 

 

NghiaPLT_0-1674096617802.png

 

And the data will be collected based on the selection from the filter. 

 

I don't want to use the unpivot solution since the data is quite large, approximately 1 million record and it will increase rapidly, so it would not be an optimal solution.

 

I also tried to write DAX to create calculated table but it did not work and raise error (The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value):

 
data_filter =
if(ISFILTERED(slicer_filter[FILTER]) = "Age",
SUMMARIZE(ab_member_phase_azure,
    ab_member_phase_azure[USER_ADDRESS],
    ab_member_phase_azure[PHASE],
    ab_member_phase_azure[TENANT_NAME],
    ab_member_phase_azure[AGE]),
if(ISFILTERED(slicer_filter[FILTER]) = "Rank",
SUMMARIZE(ab_member_phase_azure,
    ab_member_phase_azure[USER_ADDRESS],
    ab_member_phase_azure[PHASE],
    ab_member_phase_azure[TENANT_NAME],
    ab_member_phase_azure[RANK_ENG]),
SUMMARIZE(ab_member_phase_azure,
    ab_member_phase_azure[USER_ADDRESS],
    ab_member_phase_azure[PHASE],
    ab_member_phase_azure[TENANT_NAME],
    ab_member_phase_azure[GENDER])
))

 

I hope you guys can instruct me to solve the problem that I am facing. Thanks a lot.

1 ACCEPTED SOLUTION
Idrissshatila
Super User
Super User

Hello @Anonymous ,

 

Try using field parameters, check this link to get the instructions https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Idrissshatila
Super User
Super User

Hello @Anonymous ,

 

Try using field parameters, check this link to get the instructions https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Anonymous
Not applicable

Thanks for your suggestion. That's what I am looking for to solve my problem. Thanks a lot.

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.