Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
The DAX I list below is working fine, but I'm off my DAX game today and when I try to also exlude some values from a different column in the same table I end up just summing everything that doesn't have them which gives every item the same sum.
I want to exclude any instances where udv_SalesItems[Item Produc ID ud5] is equal to "1307", "1320", "1321", or "1322"
Current code without exclusion:
2018 Item Count = CALCULATE(
SUM(
udv_SalesItems[Value Item Qty]),
udv_SalesItems[Item_Class] IN {"FG1001", "FG1002", "FG1003", "FG1005"},
udv_SalesItems[Date_Year] = 2018
)
Hi @noannish
try
2018 Item Count = CALCULATE(
SUM(
udv_SalesItems[Value Item Qty]),
udv_SalesItems[Item_Class] IN {"FG1001", "FG1002", "FG1003", "FG1005"},
udv_SalesItems[Date_Year] = 2018,
NOT (udv_SalesItems[Item Produc ID ud5] IN {"1307", "1320", "1321", "1322"})
)
do not hesitate to give a kudo to useful posts and mark solutions as solution
Thank you for trying, unfortunately it still sums everything where those ud5s do not exist, giving every item the same amount. Not the end of the world that I can't figure out how to do it within the measure, just would have been nice.
maybe
2018 Item Count = CALCULATE(
SUM(udv_SalesItems[Value Item Qty]),
FILTER(ALL(),
AND(AND(udv_SalesItems[Item_Class] IN {"FG1001", "FG1002", "FG1003", "FG1005"},
udv_SalesItems[Date_Year] = 2018),
NOT (udv_SalesItems[Item Produc ID ud5] IN {"1307", "1320", "1321", "1322"}))
)
)
do not hesitate to give a kudo to useful posts and mark solutions as solution
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |