Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

DAX filter

Hi,

 

I need to calculate the Sales of a team ignoring the Single salesperson selection but considering the team the person belongs to:team sales power bi.PNG 

In this case, I need the team sales to be the sum of ONLY France sales. I wrote the formula 

Team Sales = CALCULATE([Individual sales],all('Kam - team'[Kam]))
 
which is not considering the Kam filter, as I wanted, but it is returning the total sales of all of the teams and I need only France.
 
Thanks,

 

 

 

7 REPLIES 7
v-xicai
Community Support
Community Support

Hi @Anonymous  ,

 

Does that make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You may create measure like DAX below.

 

Team Sales= CALCULATE([Individual sales], FILTER(ALLSELECTED('Kam - team'[Team]), 'Kam - team'[Team] =MAX('Kam - team'[Team])))

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

Selecting in a variable and using is later should give

 

Team Sales = 
 var _team= allselected('Kam - team'[Team])
 return
 CALCULATE([Individual sales],all('Kam - team'[Kam]),'Kam - team'[Team] =_team)
or
CALCULATE([Individual sales],all('Kam - team'[Kam]),'Kam - team'[Team] in _team)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Team Sales = CALCULATE(
sum([Individual sales]),
all('Kam-team'[salesperson]),
allselected('Kam - team'[Kam]))

Maybe something like this?

Not sure if { all('Kam-team'[salesperson]),} is needed

Anonymous
Not applicable

Hi wvdv,

 

Thanks for your answer.

 

Actually I have this dimension table:

 

kam-teams pics.PNG

I need that  if the filter is Tiphaine Boehm team sales sum all of the sales when team = FR, if the filter is Tania Gracia then sum all of the sales with team = ES etc

Anonymous
Not applicable

Okay this works in my test:
Where table 1 has two columns: kam and team.
Table 2 has two columns: kam and sales.
I only recreated part of your table.
Relationship is one to many from table 1 to table 2.
 
Measure = CALCULATE(SUM(Table2[Sales]),
ALL(Table1[Kam]),
ALLSELECTED(Table1[Team]))
Anonymous
Not applicable

Btw: be aware that in my example, you would have to filter kam on table 1, not on table 2.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors