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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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.

Anonymous
Not applicable

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.