Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @mossshvlw
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! 🙂
Hi @mossshvlw
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?
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
@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.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
But what if I just want to filter the rows in the table? And not do any calculations or aggregations?
@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 still way beyond their comprehension! |
DAX is simple, but NOT EASY! |