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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.