Forum Discussion

joshua1990's avatar
joshua1990
Post Prodigy
2 years ago
Solved

Measure as filter?

I have a simple table that shows the sales based on 4 tables (master data, sales, budget, calendar).
Now I would like to use a filter at the top of the report with which I can filter whether an article has sales > 0 and whether we also had a budget > 0.
On what basis can I set up these filters?
Unfortunately, measures cannot be set up as a filter.

  • Hi joshua1990 ,

     

    You can create a column wich has the value 'has_sales' and 'has_budget' : 

    ColumnFilter = 
    IF(
        'Table'[sales] > 0, 
        "has_sales", 
        IF(
            'Table'[budget] > 0, 
            "has_budget", 
            BLANK()
        )
    )

     

    From this column you can filter your data.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi joshua1990 ,

     

    What everyone else has said makes a lot of sense.

     

    First, make sure your four tables are properly related to each other.

     

    Second, are your "sales" and "budget" column names?

     

    If so, drag "sales" and "budget" to the Filter at the visual object level and set the condition to is greater than 0.

     

    If you have any other questions please feel free to contact me.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

8 Replies

  • Hi joshua1990 ,

     

    You can create a column wich has the value 'has_sales' and 'has_budget' : 

    ColumnFilter = 
    IF(
        'Table'[sales] > 0, 
        "has_sales", 
        IF(
            'Table'[budget] > 0, 
            "has_budget", 
            BLANK()
        )
    )

     

    From this column you can filter your data.

  • Unfortunately, measures cannot be set up as a filter.

    Measures can be used as "Filter on this visual".

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi joshua1990 ,

     

    What everyone else has said makes a lot of sense.

     

    First, make sure your four tables are properly related to each other.

     

    Second, are your "sales" and "budget" column names?

     

    If so, drag "sales" and "budget" to the Filter at the visual object level and set the condition to is greater than 0.

     

    If you have any other questions please feel free to contact me.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

  • Greg_Deckler 

    Sorry to come back to a closed topic but it would be really helpful to have a general pattern to treat this scenarios. All the solutions I've seen - including this one - do in fact work but they are heavy to implement and scale terribly.

    I have a requirement to use some metrics to identify "problematic" customers.

    Basically users have defined a few criteria, like "Has a lower margin than the average", "Pays later than the average", "Issues fewer orders than the average", stuff like that. 

    This is in my experience a common scenario but if we have to apply the proposed solution, the measures and the model become exponentially complex and the performance deteriorates rapidly with the increase of data volume.

    Any suggestion or opinion is greatly appreciated!

    • lbendlin's avatar
      lbendlin
      Super User

      Have you considered using CoPilot to ask these kinds of questions of your sematic model?

      • MattiaColuccia's avatar
        MattiaColuccia
        Advocate I

        This is a good suggestion and I can definitely try but the transformative journey towards Copilot is very much on-going, not all users are allowed/willing/capable/trained/confident to use Copilot yet.