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

后端 未结 2 1055
终归单人心
终归单人心 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:06

    To my knowledge, there is no such built-in slicer feature in Power BI at the time being. There is however a suggestion in the Power BI forum that requests a functionality like this. If you'd be willing to use the Power Query Editor, it's easy to obtain the values you're looking for, but only for hard-coded values for your limits or thresh-holds.

    Let me show you how for a synthetic dataset that should fit the structure of your description:

    Dataset:

    CustomerID,Country,Gender,TransactionValue12,NPurchases12
    51,USA,M,3516,1
    58,USA,M,3308,12
    57,USA,M,7360,19
    54,USA,M,2052,6
    51,USA,M,4889,5
    57,USA,M,4746,6
    50,USA,M,3803,3
    58,USA,M,4113,24
    57,USA,M,7421,17
    58,USA,M,1774,24
    50,USA,F,8984,5
    52,USA,F,1436,22
    52,USA,F,2137,9
    58,USA,F,9933,25
    50,Canada,F,7050,16
    56,Canada,F,7202,5
    54,Canada,F,2096,19
    59,Canada,F,4639,9
    58,Canada,F,5724,25
    56,Canada,F,4885,5
    57,Canada,F,6212,4
    54,Canada,F,5016,16
    55,Canada,F,7340,21
    60,Canada,F,7883,6
    55,Canada,M,5884,12
    60,UK,M,2328,12
    52,UK,M,7826,1
    58,UK,M,2542,11
    56,UK,M,9304,3
    54,UK,M,3685,16
    58,UK,M,6440,16
    50,UK,M,2469,13
    57,UK,M,7827,6
    

    Desktop table:

    Here you see an Input table and a subset table using two Slicers. If the forum suggestion gets implemented, it should hopefully be easy to change a subset like below to an "OR" scenario:

    Transaction Value > 1000 OR Number or purchases > 10 using Power Query:

    If you use Edit Queries > Advanced filter you can set it up like this:

    The last step under Applied Steps will then contain this formula:

    = Table.SelectRows(#"Changed Type2", each [NPurchases12] > 10 or [TransactionValue12] > 1000
    

    Now your original Input table will look like this:

    Now, if only we were able to replace the hardcoded 10 and 1000 with a dynamic value, for example from a slicer, we would be fine! But no...

    I know this is not what you were looking for, but it was the best 'negative answer' I could find. I guess I'm hoping for a better solution just as much as you are!

提交回复
热议问题