Forum Discussion

danielboi's avatar
danielboi
Icon for Helper I rankHelper I
4 years ago
Solved

Simple Table and Dax makes nonsense.

Hello community,

 

I have a simple table where HC information is listed:

Cost CenterMonth Gender TypeValue
11MaleFix2
12MaleFix3
11MaleVar2
12MaleVar3
11MaleSemi2
12MaleSemi3
11FemaleFix5
12FemaleFix9
11FemaleVar6
12FemaleVar10
11FemaleSemi7
12FemaleSemi11
21MaleFix2
22MaleFix3
21MaleVar2
22MaleVar3
21MaleSemi2
22MaleSemi3
21FemaleFix5
22FemaleFix9
21FemaleVar7
22FemaleVar11
21FemaleSemi9
22FemaleSemi13

 

Import this table into Data Model and add a measure:

Male HC fix/var:=
CALCULATE(

sum([Value]),

Table1[Type] IN {"Fix", "Var"},

Table1[Gender]="Male")

 

I use this "IN" because in the original talbe I need to filter for three attributes.

 

Add a pivot table where I add the measure and want to break down the measure value according to Type. What I get is this:

 

 

Where is the issue in my DAX?

 

Thanks

D

  • danielboi's avatar
    danielboi
    4 years ago

    amitchandak Almost!

    Need to close the filter argument right after the IN operator.

     

    This way it works. Thanks for showing me the way though!

     

    Male HC fix/var:=
    CALCULATE(

    sum([Value]),

    filter(Table1, Table1[Type] IN {"Fix", "Var"}),

    Table1[Gender]="Male"

3 Replies