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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors