The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |