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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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