Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everyone!
I am having a hard time calculating average of children count in hierarchy.
For example:
Parent Product A has 2 children: B and C.
B has 3 items and C has 5 items assigned (count). Total count is 8, but how to get the average count for A? which is 4.
Many thanks!
Solved! Go to Solution.
@Gazi,
Please check if the following measure returns your expected result. If not, please share sample data of your table.
average = CALCULATE(COUNTA(Table[Item]),ALLEXCEPT(Table,Table[Product],Table[Item]))/CALCULATE(DISTINCTCOUNT(Table[Children]),ALLEXCEPT(Table,Table[Product]))
Regards,
Lydia
Hi Lydia!
Awesome!! It seems to be working! Sorry I forgot to mention - my hierarchy has 9 levels, not just 2 like in this example. So do you think I could extend your measure with a parameter or?
Many thanks!!!
@Gazi,
Please check if the following measure returns your expected result. If not, please share sample data of your table.
average = CALCULATE(COUNTA(Table[Item]),ALLEXCEPT(Table,Table[Product],Table[Item]))/CALCULATE(DISTINCTCOUNT(Table[Children]),ALLEXCEPT(Table,Table[Product]))
Regards,
Lydia
Hi Lydia!
Awesome!! It seems to be working! Sorry I forgot to mention - my hierarchy has 9 levels, not just 2 like in this example. So do you think I could extend your measure with a parameter or?
Many thanks!!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |