Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
joshua1990
Post Prodigy
Post Prodigy

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.

2 ACCEPTED SOLUTIONS
Daoud_H
Helper I
Helper I

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.

View solution in original post

v-huijiey-msft
Community Support
Community Support

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.

vhuijieymsft_0-1710828048382.png

 

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!

View solution in original post

8 REPLIES 8
MattiaColuccia
Frequent Visitor

@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!

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

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.

 

Or maybe try the Q&A visual as an intermediate option.

v-huijiey-msft
Community Support
Community Support

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.

vhuijieymsft_0-1710828048382.png

 

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!

lbendlin
Super User
Super User

Unfortunately, measures cannot be set up as a filter.

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

Daoud_H
Helper I
Helper I

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.

Greg_Deckler
Super User
Super User

@joshua1990 In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.