Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Gazi
Frequent Visitor

ALLEXCEPT for non directly related tables

Hi community!

 

I am stuck with calculating AVG count of children in hierarchy 😞 

 

My DAX code example (for 1 Level):

AVG AA = 
IF (
    [BrowseDepth] = 1,
    CALCULATE (
        COUNTA ( ArticleAttribute[ArticleAttributeID] ),
        ALLEXCEPT ( ArticleAttribute, StuctureGroupHierarchy[Level 1] )
    )
        / CALCULATE ( DISTINCTCOUNT ( StuctureGroupHierarchy[Level 2] ) )

But DAX throws this error: 

Capture4.JPG

 

 

I have 4 tables:

Capture5.JPG

 

 

Mapping_table       Article table 

ArticleRevisionID *:1 ArticleRevisionID

 

Article table          ArticleAttribute table 

ArticleRevisionID 1:* ArticleRevisionID

 

 

Please help! 

Gazi

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi Gazi ,

 

A simple way is to merge ArticleAttribute, Acticle and Mapping.Table as a new table then create one-many relationship between StructureGroupHierarchy and the new table.

 

Regards,

Jimmy Tao

View solution in original post

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

Hi Gazi ,

 

A simple way is to merge ArticleAttribute, Acticle and Mapping.Table as a new table then create one-many relationship between StructureGroupHierarchy and the new table.

 

Regards,

Jimmy Tao

v-yuta-msft
Community Support
Community Support

Hi Gazi

 

In your diagram, table 'StuctureGroupHierarchy' and table 'Mapping_table' has one-many relationship, table 'Mapping_table' and table 'Article' is  many-one relationship so that 'StuctureGroupHierarchy' and 'Article' is many-many relationship, so relationship between 'StuctureGroupHierarchy' and 'ArticleAttribute' can be one-many.

 

In addtion, as the error shows, table in the second param shoud be one-many or one-one relationship with table in the first param. So you should create a one-many relationship between the two tables.

 

Regards,

Jimmy Tao

Hi Jimmy! @v-yuta-msft

 

Thank you for your reply! Can you please specify how can I create that one-many relationship you said??

I've tried to think about it, but apparently I am not getting something...

 

Thank you a lot!!

 

Gazi

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors