Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

ALLSELECTED - ALL - ALLEXCEPT Confusion

Hi All,

 

I'm really sorry for that. There was tons of article on web about this topic but I'm still confused.

 

Please help me !


I have a table as below.  I have a value it depends on Customer and Shop.
I want to create a measure named as Total Value. It must be return total of value for each customer and it shouldn't be affected from Shop filter.
For below example it should be return in each row for customer 'AÇALYA' --> -91.95 + 59.7 + 37.5 = 5,25
                                                                                       
customer 'BİNHAN' --> -20,81 + 32,83 + 2,38 - 2,15 = 12,25

If I make a selection on Shop filter the value should not be changed.

I created a measure like but it is returning false values for me.

Total Value = CALCULATE(SUM(ZV_CRM03_Q010[Value]),ALLSELECTED(ZV_CRM03_Q010))

 

I'm really confused about this issue. I couldn't find which formula should I use. Could anyone explain me ?

  • It sounds like you want to remove the filters from both your Shop and Customer columns.  This measure should do that.  It is a small change from the previous proposed solution.

     

    Total Value = CALCULATE(SUM(ZV_CRM03_Q010[Value]),ALL(ZV_CRM03_Q010[Shop], ZV_CRM03_Q010[Customer]))

     

    Regards,

    Pat

     

7 Replies

  • az38's avatar
    az38
    Community Champion

    Anonymous 

    Your data model is not clear but maybe it will help

    Total Value = CALCULATE(SUM(ZV_CRM03_Q010[Value]),ALL(ZV_CRM03_Q010[Shop]))

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi az38 
      I have only one table named as ZV_CRM03_Q010

       

      I tried your solution. it is returning correct values on table but when I make filtering on Shop it is returning false values.

      I want to show same values for customers on second image.

       

      • hohlick's avatar
        hohlick
        Continued Contributor

        Hi Anonymous 

        Try this

        =
        SUMX(
        ALL( 'ZV_CRM03_Q010'[Shop] );
        CALCULATE(
        SUM( 'ZV_CRM03_Q010'[Value] )
        )
        )

         

  • powerbi_zone's avatar
    powerbi_zone
    Frequent Visitor

    Hello,

    It seems many users are still confused on the usage of ALL ,ALLSELECTED and ALLEXCEPT Dax filter Function .

    To ease the confusion I have prepared a simple example which clearly states the usage of each of this function in the simplest manner possible.

    Scenario : Explained using 2 slicers and 3 measures .One measure is based on ALL ,other on ALLSELECTED and last one on ALLEXCEPT.

    The below explains the usage of ALL,ALLSELECTED and ALLEXCEPT when no year is selected at a single go .This is my first example 

     

    To watch the second example and video explanation do watch