Forum Discussion

Pranali_R's avatar
Pranali_R
Frequent Visitor
2 years ago
Solved

All Function not working

CALCULATE(
    SUM(Table[marks]),
    FILTER(
        Table,
        Table[grades] = "Average"
    ),
    ALL('Calendar'[year])
 
Why is my  ALL('Calendar'[year]) not working, I want it to not be affected by this Calendar
year slicer
 

6 Replies

  • Dangar332's avatar
    Dangar332
    Resident Rockstar

    Hi, Pranali_R 

     

    you use AlLL() as a calculate modifier which remove filter context not ignore outer filter 

    for ignoring outer filter you must usr ALL()  as  a  table function.
    for more dive in ALL() function refer HERE 

     

    sumx(
       filter( 
         all('table'),    --- use as a table function so ignore outer filters
         table[grades]="Average"
       ),
       Table[marks]
     )
    
    
    or 
    
    CALCULATE(
        SUM(Table[marks]),
        FILTER(
            all(Table),
            Table[grades] = "Average"
        )
     )
    • Pranali_R's avatar
      Pranali_R
      Frequent Visitor

      Hi Dangar332 ,

       

      I understand this issue, But the thing is, my filter table and calendar table is different, so how should i accomodate the filter from 2 different tables and use ALL as a table function

      • Dangar332's avatar
        Dangar332
        Resident Rockstar

        Hi, Pranali_R 

        try below

        CALCULATE(
             SUM(Table[marks]),
             FILTER(
                all('Calendar'),
                X  -- use column name which participate in relationship b/w tables(table and calender)
             ),
             'table'[grades]="Average"
            )
  • mlsx4's avatar
    mlsx4
    Memorable Member

    Hi Pranali_R 

     

    You can do this:

     

    Measure = CALCULATE(
        SUM(Table[marks]),ALL('Calendar'[year]), Table[grades]="Average")

     

     

    • mlsx4's avatar
      mlsx4
      Memorable Member

      Pranali_R have you tried this?

      If both tables are related, it should work