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.
Why do I have 10 books on DAX formulas and Power BI and still can't find the answer to this easy problem?
I need this formula rewrote so it will work:
Intercompany Sales = CALCULATE(sum(Sales[Sales]),Sales[CustID]='10275' or '11969' or '12875' or '50013'
I need the total sales of all four of these CustID
I know I will be ashamed when I see the answer. Thanks for your help.
Solved! Go to Solution.
Intercompany Sales = CALCULATE(sum(Sales[Sales]),Sales[Sales]=10275 || Sales[Sales]=11969 || Sales[Sales]=12875 || Sales[Sales]=50013)
This assumes numeric data in Sales. If Text, enclose in "".
Intercompany Sales = CALCULATE(sum(Sales[Sales]),Sales[Sales]=10275 || Sales[Sales]=11969 || Sales[Sales]=12875 || Sales[Sales]=50013)
This assumes numeric data in Sales. If Text, enclose in "".
Thank you so much @Greg_Deckler for answering this, and thank you for asking this question @Anonymous - great community, and this is extremely helpful.
This works perfectly. I want to personally thank you for all you do on this board helping people like myself be more productive with our time.
Hi smoupre,
how would the formula look like if I wanted to filter for ranges? So Sales[Sales]>= 10275 and < 11969?
Thanks!
Right, so the filter clause can get complex quickly. So I believe something like this would work:
Intercompany Sales = CALCULATE(sum(Sales[Sales]),(Sales[Sales]>=10275 && Sales[Sales]<=11969) || Sales[Sales]=12875 || Sales[Sales]=50013)
So, that should be to include sales that are >= 10275 and <=11969 or exactly 12875 or exactly 50013
Hello @Greg_Deckler
I have the same issue, but I want to make it dynamic. For example, I have a slicer with 5 types of products and two measure:
SelectedProduct = FIRSTNONBLANK(Table[Product], Table[Product])
NumberProducts = CALCULATE(COUNTROWS(Table), FILTER(Table, Product=SelectedProduct))
What I want is the SelectedProduct to give me all(multiple) of the selected values from the slicer and calculate the NumberProducts for all of the selected. Please help me.
Thanks 🙂
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 |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |