Forum Discussion

syddemo's avatar
syddemo
Regular Visitor
6 years ago
Solved

Get average using Main Category column only but also include subcategories in the table.

I have data of this data of thre column and I want output as Avg by Column. How to achive it?

The main problem is all three columns are from different tables but I have joined them.

 

CountrystatepopulationAvg by Country
Indiapunjab20004750
Indiaharyana40004750
IndiaHimachal60004750
IndiaUP70004750
canadatoronto1000015000
canadaColumbia2000015000
  • Create a measure:

     

    Avg by Country =
    CALCULATE (
        AVERAGE ( 'Table'[population] ),
        ALLEXCEPT ( 'Table', 'Table'[Country] )
    )

     

     

    Hope this helps

    David

4 Replies

  • dedelman_clng's avatar
    dedelman_clng
    Icon for Community Champion rankCommunity Champion

    Create a measure:

     

    Avg by Country =
    CALCULATE (
        AVERAGE ( 'Table'[population] ),
        ALLEXCEPT ( 'Table', 'Table'[Country] )
    )

     

     

    Hope this helps

    David

    • syddemo's avatar
      syddemo
      Regular Visitor

      Hi dedelman_clng. Thanks for your response. Will this work even if I am using all coumns from different tables (joins)?

      • az38's avatar
        az38
        Icon for Community Champion rankCommunity Champion

        syddemo 

        it should work if you have correct relationships.

        or what do you mean by JOIN exactly? SQL-JOIN or DAX-JOIN or what?