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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
XD_BA
Regular Visitor

Remove not selected values

Hi there,
I would like to calculate the total number of contracts for a specific type of branch when I select a customer. 

Like shown on the screenshot I select the customer in the bar chart. In the table below his number of contracts (2) and the total number of contracts for his branch (6) is shown.

 

So far the numbers are correct, but I don't want the other branches to be shown. I just want to see the branch of the selected customer. My Dax function is the following:

Contracts per branch = CALCULATE( DISTINCTCOUNT( SalesTable[contract_ID] ), 
    ALL( Customers ) )

 

I guess the problem is generated through the "All (Customers)" part - first I tried using "All (Customers[Customer_ID])", but this only calculates the number of contracts for the selected customer.

 

I hope you can help me. Thanks in forward.

XD_BA_2-1601894960719.png

 

 

2 REPLIES 2
lbendlin
Super User
Super User

Why do you call Contracts per Branch "Durchschnittlicher Branchenverbrauch"?  Looks like a field mismatch to me.

 

Create a separate measure (or even a calculated column) that computes the total number of contracts and/or the total consumption,  and then reference that measure in your calculation.

Sorry, I addmit the field name might be confusing. The overall goal of the measure is to calculate the "mean consumption per branch". The total number of contracts is just part of the solution. If I get this part right the rest is easy to transfer.

 

I already tried using a separate measure for the total number of contracts and referrenced it within the shown calculation. The result was the same. The calculation returns the right number of total contracts per branch for the selected customer, but it also shows all branches and not only the branch of the selected customer.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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