Thanks all. I've re-posted a better example of my question here https://community.powerbi.com/t5/Desktop/Help-changing-measures-using-slicers-to-filter-charts/td-p/...
Thanks for your assistance!
@mossshvlw you can use this measure and put as visual level filter and put where value is not blank.
Or simply put a slicer or add a page level filter on drug type and choose "Meth" as value and it will filter the whole page.
A measure returns a single value, not a table. Two options:
DAX for option #2 would be something like this...
Measure = VAR myFilter = FILTER ( 'myTable', [drug_type] = "METH" ) RETURN CALCULATE( SUM([Something]), myFilter )
Hope this helps! 🙂
No, Your measure is false. The formula FILTER needs to be embeded into another formula to filter an expression.
What do you want to do? Can you show us some examples?
@mossshvlw filter return a table, you have to do some aggregation for example
myFilter = COUNTROWS ( FILTER ( 'myTable', [drug_type] == "METH" ) )
Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
@mossshvlw , a very fundamental concept is that a measure, at least up til now, returns a scalar value only.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is beyond their comprehension!
DAX is simple, but NOT EASY!
Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.
Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!
Join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!
Click here to read more about the May 2022 updates!