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?
What you're asking for is a dynamic calculated table, which is not possible. So maybe you can explain what your end goal is with this table rather than defining the table as your end goal. What information are you ultimately trying to answer or visualize?
AlexisOlson a thanks for chiming in on this. Essentially I need to be able to some how combined the all the static values from the profile table (profile | element1 | element2 | element3) with the aggregated averages for the same three elements from the survey respondents. Without getting too much into the nitty-gritty I'm using a Euclidean distance formula that shows me the distance from the survey elements to the profile elements. An example of this would be for all the respondents in the survey under brand number one if we were to look at their three elements (which could change dynamicly based on the filtering of the question in the survey) what would the closest distance be from the profiles in the other table essentially ranking them by distance order.
- AlexisOlson4 years agoSuper User
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.
- bcdobbs4 years agoCommunity Champion
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?
- bcdobbs4 years agoCommunity Champion
I think AlexisOlson deserves the solution on this one. I just wrapped his work in a rankx.
- PBI-Guy4 years agoHelper I
AlexisOlson my goodness thanks so much! this gets me much closer now. the only issue I have is I need to plot it on a scatter chart like below.
And I also need to make the top N variable between 5-10
Thanks again Alexis
- AlexisOlson4 years agoSuper User
Top N what though? What measure does it affect (or do you just want to limit the rows showing up on the right)?
- PBI-Guy4 years agoHelper I
AlexisOlson It would affect the "closest profile" measure to limit how many rows are showing (Dynamic between 5-10).