0
votes

I am building a power bi report and need some help figuring a DAX measure out.

I have a table that contains Usernames. I have another table which contains Usernames, Error Count and Status, as "Accepted" or "Not accepted".

I want to get the sum of Error Count per username only if they are accepted.

Tables:

Table

Username
Avinash 

Table1

Username       Errorcount       Status
Avinash            2            Accepted
Avinash            1            Not Accepted

These are the measures I've created:

EXT :=
CALCULATE (
    SUM ( 'ERRORS AFTER DTX'[Error Count] ),
    FILTER ( 'ERRORS AFTER DTX', 'ERRORS AFTER DTX'[India Status] = "Accepted" )
)

EXT :=
CALCULATE (
    SUM ( 'ERRORS AFTER DTX'[Error Count] ),
    FILTER ( 'ERRORS AFTER DTX', 'ERRORS AFTER DTX'[India Status] = "Accepted" )
    , EXACT(Table1[Users])
)

Expected Output:

Username              Error Count
Avinash                    2
2
Can you please show us what the output was for your measures?StelioK

2 Answers

1
votes

This should do the trick:

ErrorCount :=
CALCULATE (
    SUM ( 'ERRORS AFTER DTX'[Error Count] ),
    'ERRORS AFTER DTX'[India Status] = "Accepted"
)
0
votes

This would give your expected output:

ErrorCount = CALCULATE ( SUM ( 'ERRORS AFTER DTX'[Error Count] ), 'ERRORS AFTER DTX'[India Status] = "Accepted", GROUPBY(Table, USERNAME))