Forum Discussion
Hierarchical Filter & Aggregated Visualizations
Hello PowerBI Experts,
Following up on my previous post, I am now encountering a rather strange issue.
Context
I have monthly usage data from a SaaS software solution. All the monthly usage reports are pushed to the same table, and we have a separate table for a list of customers. The cloud deployment has three tiers of tenant: management, parent, and child. The management tenant is used to operate the platform and customers cannot access it. Customers are given a "parent" tenant, and they can create as many "child" tenants as they want. The data looks something like this:
Table 1: Usage Data
| Month | Tenant Name | Parent Tenant | Path | Usage Metric(s) |
| January | management | - | management | ... |
| January | parent1 | management | management|parent1 | |
| January | childA | parent1 | management|parent1|childA | |
| January | childB | parent1 | management|parent1|childB | |
| January | parent2 | management | management|parent2 | |
| January | childC | parent2 | management|parent2|childC | |
| February | management | - | management | |
| February | parent1 | management | management|parent1 | |
| February | childA | parent1 | management|parent1|childA | |
| February | childB | parent1 | management|parent1|childB | |
| February | parent2 | management | management|parent2 | |
| February | childC | parent2 | management|parent2|childC | |
| ... |
Table 2: Customer Mapping
| Customer Name | Tenant Name |
| Customer1 | parent1 |
| Customer2 | parent2 |
Current Approach
I've built a report such that you can view data on the individual tenant level and at the customer level. I accomplish this using a slicer on "Customer Name":
With a Measure:
PathContainsTenant =
var _a = SELECTCOLUMNS('Customer List',"Tenant",[Tenant])
return IF(MAX(Data[Tenant]) in _a || MAX(Data[Parent]) in _a || MAX(Data[Path Level 1]) in _a, 1, 0)
This gives me the list of tenants that have the desired customer tenant in their path. For example, if I select "CustomerA":
You can then see how "PathContainsTenant" becomes my filtering option - to find any relevant tenants, I simply just look for when PathContainsTenant = 1.
Using this, I've introduced a Hierarchy Slicer to enable you to look at each tenant individually:
The Problem
The graph on the right - "Total API Requests" is intended to be the sum of all API Requests for the selected tenants. However, it is not working as I had intended. In the above screenshot, it works properly, but as soon as I select all tenants for CustomerA, it goes blank:
Same thing happens for CustomerB:
Strangely, for CustomerC, it aggregates the entire data set (e.g. all tenants, even though the filter is set to only include tenants where PathContainsTenant = 1):
Any ideas on how I can get the graph on the right to sum properly? I will try and attach my working file if the forums will let me. edit - it won't let me attach my file, but the graph is relateively straighforward anyway: