Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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.
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
9 | |
7 |