Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Dynamic data collection from existed tables based on slicer selection

Dear all,

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

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. 

 

 

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.

2 Replies