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 All,
I have the below data structure. I have created the hierarchy and determined the paths as well.
I am trying to build a visual where in I can see the count of work items at each drill down level. However, as you can see in the below screenshot, I also get the parent counted in when I simply use the ISFILTERED and DISTINCTCOUNT. Here, there are 7 items that are linked to the Epic1 but I get the count as 8 (the one additional record is of the Epic1 itself). Similarly for Epic2, there is only one record (Capability3), but I get the count as 2.
How do I make sure that I exclude this self-reference in the count? Or is this counting approach fundamentally wrong? Thanks in advance!
Solved! Go to Solution.
Hi @Anonymous ,
Please try:
Measure =
var level1=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level1])))
var level2=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level2])))
var level3=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level3])))
var level4=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level4])))
return IF(HASONEVALUE('Table'[Level4]),level4,IF(HASONEVALUE('Table'[Level3]),level3,IF(HASONEVALUE('Table'[Level2]),level2,IF(HASONEVALUE('Table'[Level1]),level1))))
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try:
Measure =
var level1=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level1])))
var level2=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level2])))
var level3=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level3])))
var level4=CALCULATE(COUNTROWS('Table'),FILTER('Table',[Work Item Name]<>MAX('Table'[Level4])))
return IF(HASONEVALUE('Table'[Level4]),level4,IF(HASONEVALUE('Table'[Level3]),level3,IF(HASONEVALUE('Table'[Level2]),level2,IF(HASONEVALUE('Table'[Level1]),level1))))
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
105 | |
97 | |
80 | |
67 | |
63 |
User | Count |
---|---|
147 | |
110 | |
108 | |
85 | |
64 |