Forum Discussion

gregv5577's avatar
gregv5577
Regular Visitor
8 years ago
Solved

using ALL or ALLEXCEPT to create measure which ignores multiple slicers

I have a report which generates several versions of the same measure using or ignoring specific slicer selections. I can only get this to work if I construct my slicers from the fact table itself. I ...
  • v-qiuyu-msft's avatar
    8 years ago

    Hi gregv5577,

     

    You can create measures below: 

    Measure 1 = AVERAGE('OrderFactTable'[revenue])

    Measure 2 =
    DIVIDE(CALCULATE (
    SUM ( OrderFactTable[revenue] ),
    ALL ( Employee[employee_name] )
    ), CALCULATE (
    DISTINCTCOUNT(OrderFactTable[product_id]),
    ALL ( Employee[employee_name] )
    ) )

     

    Measure 3 =
    DIVIDE(CALCULATE (
    SUM ( OrderFactTable[revenue] ),
    ALL ( Employee[employee_name] ),ALL('Product'[product_name])),
    CALCULATE (
    DISTINCTCOUNT(OrderFactTable[company_id]),
    ALL ( Employee[employee_name] ),ALL('Product'[product_name])))

     

     

    You can see attached pbix file. 

     

    Best Regards,
    Qiuyun Yu

  • BILASolution's avatar
    8 years ago

    Hi gregv5577

     

    As an alternative...

     

     

     

    Measures:

     

    Total Revenue = SUM(OrderFactTable[revenue]) 
    Measure 1 = [Total Revenue] 
    Measure 2 = CALCULATE([Total Revenue];ALL(Employee[Employee_name]) )
    Measure 3 = CALCULATE([Total Revenue];ALL(Employee[Employee_name]);ALL('Product'[Product_name]))

    I hope this helps

     

    Regards

    BILASolution