Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I want to include a filter in my dax function but not sure how?
see below my new table formula (works fine)
Top5Products =
TOPN(
5,
SUMMARIZE(
'DimProduct',
'DimProduct'[ProductFlag],
'DimProduct'[ProductID],
'DimProduct'[ProductKey],
'DimProduct'[ProductName],
"Products",
SUM('FctSales'[TotalVolume])
),
[Providers]
)
I want to put in a filter that does something like this:
FILTER ( DimProduct, 'DimProduct'[ProductFlag] <> "False" )
in other words dont include any products where the product flag is False
Solved! Go to Solution.
Why dont you add this filter before the summarize
Top5Products =
TOPN(
5,
Filter(SUMMARIZE(
'DimProduct',
'DimProduct'[ProductFlag],
'DimProduct'[ProductID],
'DimProduct'[ProductKey],
'DimProduct'[ProductName],
"Products",
SUM('FctSales'[TotalVolume])
),'DimProduct'[ProductFlag]<>"False"),
[Providers]
)
Hi @Anonymous
Does it work with this one?
Top5Products = TOPN( 5, SUMMARIZE( FILTER ( 'DimProduct', 'DimProduct'[ProductFlag] <> "False" ) 'DimProduct'[ProductFlag], 'DimProduct'[ProductID], 'DimProduct'[ProductKey], 'DimProduct'[ProductName], "Products", SUM('FctSales'[TotalVolume]) ), [Providers] )
Let me know if this works for you 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! |
#proudtobeasuperuser |
Why dont you add this filter before the summarize
Top5Products =
TOPN(
5,
Filter(SUMMARIZE(
'DimProduct',
'DimProduct'[ProductFlag],
'DimProduct'[ProductID],
'DimProduct'[ProductKey],
'DimProduct'[ProductName],
"Products",
SUM('FctSales'[TotalVolume])
),'DimProduct'[ProductFlag]<>"False"),
[Providers]
)
Perfect! Thank you james
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |