Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello community,
I have a simple table where HC information is listed:
Cost Center | Month | Gender | Type | Value |
1 | 1 | Male | Fix | 2 |
1 | 2 | Male | Fix | 3 |
1 | 1 | Male | Var | 2 |
1 | 2 | Male | Var | 3 |
1 | 1 | Male | Semi | 2 |
1 | 2 | Male | Semi | 3 |
1 | 1 | Female | Fix | 5 |
1 | 2 | Female | Fix | 9 |
1 | 1 | Female | Var | 6 |
1 | 2 | Female | Var | 10 |
1 | 1 | Female | Semi | 7 |
1 | 2 | Female | Semi | 11 |
2 | 1 | Male | Fix | 2 |
2 | 2 | Male | Fix | 3 |
2 | 1 | Male | Var | 2 |
2 | 2 | Male | Var | 3 |
2 | 1 | Male | Semi | 2 |
2 | 2 | Male | Semi | 3 |
2 | 1 | Female | Fix | 5 |
2 | 2 | Female | Fix | 9 |
2 | 1 | Female | Var | 7 |
2 | 2 | Female | Var | 11 |
2 | 1 | Female | Semi | 9 |
2 | 2 | Female | Semi | 13 |
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
Solved! Go to Solution.
@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")
@danielboi , try like
Male HC fix/var:=
CALCULATE(
sum([Value]),
filter(Table1, Table1[Type] IN {"Fix", "Var"},
Table1[Gender]="Male") )
refer if if needed http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/
@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")
@danielboi , sorry one mistake from my side
Male HC fix/var:=
CALCULATE(
sum([Value]),
filter(Table1, Table1[Type] IN {"Fix", "Var"} &&
Table1[Gender]="Male") )
User | Count |
---|---|
77 | |
74 | |
62 | |
61 | |
45 |
User | Count |
---|---|
108 | |
100 | |
91 | |
83 | |
61 |