Forum Discussion

PBI_user_mumbai's avatar
PBI_user_mumbai
Regular Visitor
1 year ago

ALL() DAX not working as expected

I have a dax that calculates Seat Utilization as 

New Seat Requirement =

var A = SUMMARIZE(Fact_Workmodel,Fact_Workmodel[FCT Load Date-week start date],Fact_Workmodel[Associate ID],"Seat_Requirements",DISTINCT(Fact_Workmodel[Seat Requirement]))

RETURN SUMX(A,[Seat_Requirements])

I need this to be divided by a value that is the sum of this new Seat utilization ignoring any filter on [Practice].
Hence created the Total Seat Utilization as

Total Seat Requirement =

CALCULATE([New Seat Requirement],ALL(Dim_RegionMapping_vw[Practice]))
Upon placing these measures into a table view, I get the below result. Which is fine. 

But upon selecting a particular Practice from a slicer, The total Seat requirement is not expected to change, but it changes.
as below. Need support in fixing this.

 

8 Replies

    • PBI_user_mumbai's avatar
      PBI_user_mumbai
      Regular Visitor

      But I want this to not change based on [Practice] column selection only. It should change based on any other column selection from this table(Regionmapping_vw).

      • nilendraFabric's avatar
        nilendraFabric
        Icon for Super User rankSuper User

        please try this 


        Total Seat Requirement =
        CALCULATE(
        [New Seat Requirement],
        REMOVEFILTERS(Dim_RegionMapping_vw[Practice])
        )

  • Hi PBI_user_mumbai 

     

    The filter modifier is applied to Dim_RegionMapping_vw[Practice]. Are you using the same column in your table viz?

  • Hello PBI_user_mumbai ,

     

    Try below dax pls :

    New Seat Requirement =
    VAR A = SUMMARIZE(
    Fact_Workmodel,
    Fact_Workmodel[FCT Load Date-week start date],
    Fact_Workmodel[Associate ID],
    "Seat_Requirements", DISTINCT(Fact_Workmodel[Seat Requirement])
    )
    RETURN SUMX(A, [Seat_Requirements])

     

     

    Total Seat Requirement =
    CALCULATE([New Seat Requirement], REMOVEFILTERS(Dim_RegionMapping_vw[Practice]))

     

    I hope this helps.

     

    Regards,

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi PBI_user_mumbai 

     

    You can try to modify the code as follows:

     

    New Seat Requirement =
    VAR A = 
        SUMMARIZE(
            Fact_Workmodel,
            Fact_Workmodel[FCT Load Date-week start date],
            Fact_Workmodel[Associate ID],
            "Seat_Requirements", DISTINCT(Fact_Workmodel[Seat Requirement])
        )
    RETURN SUMX(A, [Seat_Requirements])

     

    Total Seat Requirement =
    CALCULATE(
        [New Seat Requirement],
        REMOVEFILTERS(Dim_RegionMapping_vw[Practice]),
        VALUES(Dim_RegionMapping_vw)
    )

     

    If you're still having problems, provide some dummy data and the desired outcome. It is best presented in the form of a table. This will help resolve your issue.

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.