Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have the following datasets related 1:M via the ID field. When I use the measure below to get the totals in a matrix, the All Clients measure gets the total for the entire dataset, including the countries not shown in the matrix. How can I modify the All Clients measure to just show the totals for the displayed countries?
~Selected Client =
CALCULATE(
COUNTROWS('Findings')
)
~All Clients =
CALCULATE(
COUNTROWS('Findings'),
ALLEXCEPT(
'Data',
'Calendar',
'Data'[Country],
'Data'[Type],
'Data'[Service],
'Data'[Profile]
)
)
Selected Client shows the correct row count; All Clients shows the correct total for each country, but the total shows the total row count for the entire dataset - including the countries not displayed.
Data
ID | ClientName | Country | Type | Service | Profile |
644164 | Client | China | Initial | SOC | Client Standard |
617872 | Client | Indonesia | Initial | SOC | Client Standard |
623246 | Global | Japan | Initial | SOC | Client Standard |
585442 | Global | China | Initial | SOC | Client Standard |
582886 | Client | China | Initial | SOC | Client Standard |
582769 | Client | South Korea | Initial | SOC | Client Standard |
Finding
ID | Finding |
644164 | Finding 2 |
644164 | Finding 3 |
644164 | Finding 4 |
617872 | Finding 5 |
617872 | Finding 6 |
623246 | Finding 7 |
623246 | Finding 8 |
623246 | Finding 9 |
585442 | Finding 10 |
585442 | Finding 11 |
582886 | Finding 12 |
582769 | Finding 13 |
582769 | Finding 14 |
Essentially, the output using the sample data (if I filtered the page with the field Client = "Client"):
Country | Selected Client | All Clients |
China | 2 | 1 |
Indonesia | 1 | |
South Korea | 1 |
Hi @olimilo
You can create a new measure
Total_AllClients = SUMX(VALUES(Data[Country]),[~All Clients])
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |