Power BI Dashboard where the core filter condition is a disjunction on numeric fields

后端 未结 2 1049
终归单人心
终归单人心 2020-12-11 19:38

We are trying to implement a dashboard that displays various tables, metrics and a map where the dataset is a list of customers. The primary filter condition is the disjunct

2条回答
  •  粉色の甜心
    2020-12-11 20:10

    The key here is to create separate parameter tables and combine conditions using a measure.

    Suppose we have the following Sales table:

    Customer  Value  Number
    -----------------------
    A         568     2
    B         2451   12
    C         1352    9
    D         876     6
    E         993    11
    F         2208   20
    G         1612    4
    

    Then we'll create two new tables to use as parameters. You could do a calculated table like

    Number = VALUES(Sales[Number])
    

    Or something more complex like

    Value = GENERATESERIES(0, ROUNDUP(MAX(Sales[Value]),-2), ROUNDUP(MAX(Sales[Value]),-2)/10)
    

    Or define the table manually using Enter Data or some other way.

    In any case, once you have these tables, name their columns what you want (I used MinNumber and MinValue) and write your filtering measure

    Filter = IF(MAX(Sales[Number]) > MIN(Number[MinCount]) ||
                MAX(Sales[Value])  > MIN('Value'[MinValue]),
                1, 0)
    

    Then put your Filter measure as a visual level filter where Filter is not 0 and use MinCount and MinValues column as slicers.

    If you select 10 for MinCount and 1000 for MinValue then your table should look like this:

    Notice that E and G only exceed one of the thresholds and tha A and D are excluded.

提交回复
热议问题