- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Connect 2 tables with hierarchical "Category" values
I have 2 tables: Families and Parameters. Each family and each parameter has an assigned category. The categories consist of 3 digits from 1-9, with the possibility of a 0 in position 2, or in positions 2 and 3 in the case of no subcategory. The task is to assign parameters to families. And the biggest problem: the category consists of 3 levels. Not all parameters reach the lower subcategories. This means that they apply to all subcategories. For example, a parameter with a category of 400 (main category 4, 2 unspecified subcategories) applies to all families in the main category 4, i.e., from 411 to 499. But a parameter with a category of 438 applies only to families in the same category. And vice versa: selecting a family with a category of 357, I should get all parameters from the following categories: 357, 350, 300. Because if a parameter has a category of 350, it means it should be assigned to all families with a category of 35x.
How can I visualise it?
I mean to create 2 separate visuals (one common would be nod bad as well): one with families, the second one with parameters. If I chose one familie, I want to se all associated parameters.
I tried with hierarchies (split category into 3 separate columns and set a hierarchy) but I had no idea hot to connect then the tables in the model.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I wrote this in Python, maybe someone can translate it into Power BI?
return num, num // 10 * 10, num // 100 * 100
import pandas as pd
# Family dataframe
fam_data = {'Family': [f'Family{i}' for i in range(1, 92)],
'Category': [num for num in range(400, 500) if num < 401 or num > 409]}
df_fam = pd.DataFrame(fam_data)
# Parameter dataframe
par_data = {'Parameter': [f'Parameter{i}' for i in range(1, 92)],
'Category': [num for num in range(400, 500) if num < 401 or num > 409]}
df_par = pd.DataFrame(par_data)
def round_numbers(num):
return num, num // 10 * 10, num // 100 * 100
def my_function (fam_category):
cat, cat_10, cat_100 = round_numbers(fam_category)
filtered_params = df_par[df_par['Category'].isin([cat, cat_10, cat_100])]
return(filtered_params)
number = random.randint(410, 500)
print(number)
print(my_function(number))
Parametr Category
0 Parametr1 400
81 Parametr82 490
88 Parametr89 497

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Join our Community Sticker Challenge 2025
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Subject | Author | Posted | |
---|---|---|---|
08-02-2024 11:49 AM | |||
07-11-2023 02:26 AM | |||
07-19-2024 09:05 AM | |||
01-23-2024 11:00 PM | |||
12-21-2018 09:37 AM |
User | Count |
---|---|
102 | |
68 | |
66 | |
51 | |
41 |
User | Count |
---|---|
164 | |
84 | |
68 | |
66 | |
61 |