Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Filter data based on certain measure's value range without losing the other measures in a chart

Dear community members! I'm new to Power BI (worked with it for about three weeks now :-)) so my question (or data) may not be well formulated, apologies for that.   I got a request to show multip...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous,

    You can try to use the following measure formula to replace your value field used on the chart, it will replace the selected attribute not matched value parts to blank and not affect other attributes value: (they may reduce the effect on chart graph and axis unit ranges)

    Measure =
    VAR selectValue =
        VALUES ( Table[Value] )
    VAR selectAttr =
        VALUES ( Table[Attribute] )
    VAR currAttr =
        SELECTEDVALUE ( 'anon longdata'[Attribute] )
    VAR currValue =
        AVERAGE ( 'anon longdata'[value] )
    RETURN
        IF (
            currAttr IN selectAttr,
            IF ( currValue IN selectValue, currValue ),
            currValue
        )

    Regards,

    Xiaoxin Sheng