Forum Discussion

PBI-Guy's avatar
PBI-Guy
Helper I
4 years ago
Solved

Summarize table with dynamic filtering

Hello Team, I need some major help to solve this issue. I have a summarized calculated table that I need to be able to filter dynamically. Below is a sample of the calculated table that I have a unio...
  • AlexisOlson's avatar
    AlexisOlson
    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.

  • bcdobbs's avatar
    bcdobbs
    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?