Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi All,
I am looking to add a measure that calculates quantity count based on scenario below.
1. Think of below as a row data.
2. Think of below as a hierarchy when put on a matrix visual
So now I want to calculate quanitty as below.
- Root appears (topmost item in the hierarchy) once in row data so qty for same is 1
- Assembly is a child of root and appears twice in the row data, it can be termed as root has two children, both named assembly so qty for that is calcualted as 2.
- Now, Part A appears to be used only once in each assembly so qty for same is 1.
- part B however is used twice in each assembly, so qty for same is 2.
Can someone please help me with the formula for measure on this, I would really appreciate it, thanks in advance.
Solved! Go to Solution.
Hi @Anonymous,
Did you mean to use different rates based on current hierarchy levels?
If that's the case, you can take a look at the following link to know how to use 'if statement' to check current hierarchy levels. (you can use it to dynamic replace the result rates based on the current category )
Clever Hierarchy Handling in DAX - SQLBI
In addition, you can also check the below link about selectedvalue and switch functions if helps:
Regards,
Xiaoxin Sheng
Hi @Anonymous,
Did you mean to use different rates based on current hierarchy levels?
If that's the case, you can take a look at the following link to know how to use 'if statement' to check current hierarchy levels. (you can use it to dynamic replace the result rates based on the current category )
Clever Hierarchy Handling in DAX - SQLBI
In addition, you can also check the below link about selectedvalue and switch functions if helps:
Regards,
Xiaoxin Sheng
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
42 | |
30 | |
27 | |
27 |