Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Help with Calculate arguments

I have a table visual with a measure, and one of the columns in the visual needs to be ignored in caulcating the measure.  I can use the ALL argument, but then it also ignores a slicer I have on the report (because they are consuming the same table column)

 

Is there a way to force the measure to ignore the column in the visual, but not the slicer...?

5 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous

    Try to use ALLEXCEPT instead of ALL, put the column "a" which is used in a slicer to the ALLEXCEPT like this "ALLEXCEPT(table,table[a])

     

    Best Regards

    Maggie

    • Anonymous's avatar
      Anonymous
      Not applicable

      Unfortunately, that doesn't work.

       

      Data Table:

      IDAgeCountry
      133Canada
      244USA
      355USA
      443Canada
      554USA
      675America
      712America
      847Canada
      923USa
      1038Canada

       

       

      Mapping Table 

      CountryMapped
      CanadaCanada
      USAUSA
      AmericaUSA

       

       

      There is a relationship between Country for both tables.  I have one measure:  Measure = Average(Sheet1[Age])

      Here is the Table Visual with the measure as is:


      So I adjust the measure to be: Measure = CALCULATE(Average(Sheet1[Age]),all(Sheet1[ID]))

      Now it looks likes this:

       

       

      You can see how it now shows duplicates for every value in the mapping table, and the average age is for for mapped country.  So I try:  Measure = CALCULATE(Average(Sheet1[Age]),allexcept(Sheet1,Sheet1[Country]))

      The average age is correct, but the duplicates are still there.

       

       

      • jthomson's avatar
        jthomson
        Solution Sage

        What's your desired output? It looks like the measure is working