Forum Discussion
Summarize table with dynamic filtering
- 4 years ago
OK. We can certainly compute distances without needing an extra calculated table in the model. For example,
Closest Profile = VAR E1 = AVERAGE ( Survey[Element1] ) VAR E2 = AVERAGE ( Survey[Element2] ) VAR E3 = AVERAGE ( Survey[Element3] ) RETURN MINX ( TOPN ( 1, Profile, ( E1 - Profile[_Element1] ) ^ 2 + ( E1 - Profile[_Element1] ) ^ 2 + ( E1 - Profile[_Element1] ) ^ 2, ASC ), Profile[Profile] )You can make all this dynamic without a calculated table:
See attached.
- 4 years ago
Kudos to AlexisOlson for asking the right question to move this forward!
Rather than TopN do what you want:Avg Distance Rank = RANKX( ALLSELECTED(Profile[Profile]), [Avg Distance], , ASC, Dense )and use it in the visual filter?
https://1drv.ms/u/s!Ap_eXUht9lqhhT4VlI7mT6vHYeme?e=ZBN9dl
Please see attached one drive link to the pbix file. I want to be able to summarize the brand dynamically so that when I filter on the survey questions I gives me the proper aggregated averages for the elements 1 -3 in the 02Profile_Calculated table which feeds back into the 01MergeDataSet which is the table that drives my visuals and filters. I hope this makes sense because I do have a hard time explaining it but if you need more I will do what I can
I can't see a 02Profile_Calculated in the file you've sent.
At first glance you have lots of dimension tables like Education_tbl but they're not related to your main fact tables. Am I looking at the right version?
- PBI-Guy4 years agoHelper I
bcdobbs so sorry wrong version should only be 5 tables in total I replaced the file try again and let me know if you have any issues
https://1drv.ms/u/s!Ap_eXUht9lqhhT4VlI7mT6vHYeme?e=uEQn4J
so the goal is to somehow be able to have a measure that can dynamically filter the first union Join for the brands so that the averages change based on the filter context. The second table in the union join is ok. hope this makes sense.
- bcdobbs4 years agoCommunity Champion
Really sorry I've had a look but I can't follow what you're trying to achieve.
I can see the two tables and the union join between them but they look like very different sets of data so not sure what you're trying to achieve. Can you give a numeric example of an output you would expect based on a particular filter.
- PBI-Guy4 years agoHelper I
bcdobbs ok, I understand but I will try to break it down step by step as easily as I can because I do have a hard time explaining it so here goes.
Step 1: The first table is the Survey table which is the table that has all the data for the master survey taken by various respondents. The Survey has 4 questions that have various responses.
The 3 element fields are scores for each survey respondent.
Step 2: The second table is the profile table that has static data for various user profiles. This table is not related to that Survey table but does have the same 3 element fields. However, this table is static and does not change.
Step 3: This is where I need the magic to happen the profile calculated table is the union between the profile table and the survey table to create a new profile table that now includes the summarized average for the 3 elements from the surveys table. So the final output should be a new table or measure that combines the static profile table with the 3 elements and the aggregated brand as shown in the below screenshot.
Filtering: The second thing that I need and where I am stuck is the ability to filter the Survey questions and have that filter adjust the summarized Brand elements.
I hope this helps, its difficult to explain but that is the best I can do. please let me know if you need more context.
.