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.
Greetings,
I have a set of data organized like a tree (site > ug > régie > cité > batiment > logement) that represents real estate.
To each site is assigned a certain number of person working all over the site. (DDE & Postes)
Data set
A have a slicer over "Cité" to select a group of building, and taking a simple measure : count of logement_code : will give me the number of rooms all over a group of building.
So far, it's quite easy.
Now if i drop the "Site"'s name in a pivot table & the same measure: number of rooms. It will give me the same result as the previous pivot table.
How can I have a slicer selecting a "Cité" (level 4 of my tree) that affects a pivot table that will show the level 1's name and the amount of rooms all over the level 1 ?
Example:
I'm sure there's a nice complex DAX formula to make it work. Anyone could help me through ?
Thanks a lot ! 🙂
Nicolas
Solved! Go to Solution.
Hi @NKD ,
You can use the 'RELATED' function.
RELATED function (DAX) - DAX | Microsoft Learn
The Table data is shown below:
Use the following DAX expression to create a measure
Measure =
VAR _a = MAXX('Table3',RELATED(Table1[Type]))
VAR _b = SELECTEDVALUE('Table1'[Type])
VAR _c =
IF( _b <> _a,BLANK(),
CALCULATE(SUMX(FILTER('Table4',RELATED(Table1[Type]) = _a),[Sales]),ALL(Table3[Product])))
RETURN _c
Final output
Hi @NKD ,
You can use the 'RELATED' function.
RELATED function (DAX) - DAX | Microsoft Learn
The Table data is shown below:
Use the following DAX expression to create a measure
Measure =
VAR _a = MAXX('Table3',RELATED(Table1[Type]))
VAR _b = SELECTEDVALUE('Table1'[Type])
VAR _c =
IF( _b <> _a,BLANK(),
CALCULATE(SUMX(FILTER('Table4',RELATED(Table1[Type]) = _a),[Sales]),ALL(Table3[Product])))
RETURN _c
Final output
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |