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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors