Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi,
I like to show in addition to a table showing the number of inhabitants for selected districts or neighbourhoods a table with the number of inhabitants of the matching parent area: the municipality, the province and the entire country.
The nature of the source data makes that the child levels don’t add up to it’s parent level. So for example, the sum of the inhabitants of the districts do not equal the number of inhabitants of the municipality. Therefore the user has to select at which arealevel they like to analyse the data.
In order to give additional perspective to the data, I like to show, as mentioned before, the figures of the related parent area levels in a second separate table:
And when selecting another district:
The above images show the desired outcome, which I am not able to achieve yet.
I use a measure ('Relevant parent area') to determine whether a parent are is relevant to show or not.
The difficulty comes from the fact that the Dim_Area table and the Fact table both are being filtered by slicers. That information is needed to determine the relevant parent areas. At the same time these slicers filter the Fact table and therefore prevent showing the values from the relevant parent areas.
Editing the interactions between the slicers and the parent area table makes the values return, but also removes the slicer information to determine the relevant parent areas.
I duplicated the Dim_Area table in order to determine the relevant parent areas. Is it needed to duplicate the fact table as well to achieve this or is there another solution? In the original model the fact table consists of multiple fact tables each being rather large. Duplication is therefore not my first preference.. Furthermore, a field parameter is used to determine what columns to show equally in both tables.
An unpivoted view of the data:
PBIX-file and Excel datafile attached:
Solved! Go to Solution.
Hi @SebV
You can refer to the following solution.
1.In dim_areas create the following calculated column
PV_IDS = var a=MAXX(FILTER(Dim_Areas,CONTAINSSTRING([Area_type],0)),[Area_id])
RETURN IF(CONTAINSSTRING([Area_type],1),a,Dim_Areas[Related PV_id])
2.I removed the dim_duplicate table. and create a new table. There is no relationship with this table.
Table =
VAR a =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "0" ) ),
[Area_name],
[Area_id],
[PV_IDS]
)
VAR b =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "1" ) ),
[Area_name],
[Area_id],
[PV_IDS]
)
VAR c =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "2" ) ),
[Area_name],
[Area_id],
[Related PV_id]
)
VAR d =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "3" ) ),
[Area_name],
[Area_id],
[Related MU_id]
)
VAR e =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "4" ) ),
[Area_name],
[Area_id],
[Related DI_id]
)
RETURN
UNION ( a, b, c, d, e )
And in the new table create a calculated column.
Path = var a=PATH('Table'[Area_id],'Table'[PV_IDS])
return SUBSTITUTE(a,[Area_id],"")
3.Then create a calculated columns in dim_area table.
Pathdetail = LOOKUPVALUE('Table'[Path],'Table'[Area_id],[Area_id])
4.Then create the following measures.
Measure = IF(ISFILTERED(Dim_Areas[Related MU_name]),COUNTROWS(FILTER(Dim_Areas,CONTAINSSTRING([Pathdetail],MAX('Table'[Area_id])))),1)Inhabitants_1 = CALCULATE(SUM(Fact_Inhabitants[Value]),'Fact_Inhabitants'[Indicator] = "Inhabitants",Fact_Inhabitants[Area_id] in VALUES('Table'[Area_id]),CROSSFILTER(Dim_Areas[Area_id],Fact_Inhabitants[Area_id],None))Male inhabitants (%)_1 = CALCULATE(SUM(Fact_Inhabitants[Value]),'Fact_Inhabitants'[Indicator] = "Men (%)",Fact_Inhabitants[Area_id] in VALUES('Table'[Area_id]),CROSSFILTER(Dim_Areas[Area_id],Fact_Inhabitants[Area_id],None))
Then create a table visual, and put the following field to the visual.
And put the measure to the table visual filter.
Output
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.
Wow! Thanks!
But, I don't understand how this solution works. Can you explain what the idea behind your solution is?
And one issue: both tables were originaly responding to the same field parameter.
In your solution the columns in the lower table don't change when the field parameter is changed for the upper table.
Best Regards,
Sebastiaan
Hi @SebV
Thanks for your quick reply, the logic of the solution is that create a new table to create the path for the levels, then you can use it, and for the second question, you need to create a new paramater for the two new measures.
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.
Hi @SebV
You can refer to the following solution.
1.In dim_areas create the following calculated column
PV_IDS = var a=MAXX(FILTER(Dim_Areas,CONTAINSSTRING([Area_type],0)),[Area_id])
RETURN IF(CONTAINSSTRING([Area_type],1),a,Dim_Areas[Related PV_id])
2.I removed the dim_duplicate table. and create a new table. There is no relationship with this table.
Table =
VAR a =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "0" ) ),
[Area_name],
[Area_id],
[PV_IDS]
)
VAR b =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "1" ) ),
[Area_name],
[Area_id],
[PV_IDS]
)
VAR c =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "2" ) ),
[Area_name],
[Area_id],
[Related PV_id]
)
VAR d =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "3" ) ),
[Area_name],
[Area_id],
[Related MU_id]
)
VAR e =
SUMMARIZE (
FILTER ( Dim_Areas, CONTAINSSTRING ( [Area_type], "4" ) ),
[Area_name],
[Area_id],
[Related DI_id]
)
RETURN
UNION ( a, b, c, d, e )
And in the new table create a calculated column.
Path = var a=PATH('Table'[Area_id],'Table'[PV_IDS])
return SUBSTITUTE(a,[Area_id],"")
3.Then create a calculated columns in dim_area table.
Pathdetail = LOOKUPVALUE('Table'[Path],'Table'[Area_id],[Area_id])
4.Then create the following measures.
Measure = IF(ISFILTERED(Dim_Areas[Related MU_name]),COUNTROWS(FILTER(Dim_Areas,CONTAINSSTRING([Pathdetail],MAX('Table'[Area_id])))),1)Inhabitants_1 = CALCULATE(SUM(Fact_Inhabitants[Value]),'Fact_Inhabitants'[Indicator] = "Inhabitants",Fact_Inhabitants[Area_id] in VALUES('Table'[Area_id]),CROSSFILTER(Dim_Areas[Area_id],Fact_Inhabitants[Area_id],None))Male inhabitants (%)_1 = CALCULATE(SUM(Fact_Inhabitants[Value]),'Fact_Inhabitants'[Indicator] = "Men (%)",Fact_Inhabitants[Area_id] in VALUES('Table'[Area_id]),CROSSFILTER(Dim_Areas[Area_id],Fact_Inhabitants[Area_id],None))
Then create a table visual, and put the following field to the visual.
And put the measure to the table visual filter.
Output
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.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 41 | |
| 30 | |
| 24 |