Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi.
Trying to sum a data field only if the sum of it is < 0 else do not sum it or return 0. IF statement or filter be best. I have over 3M records.
For example.
Acct # | Count |
999727 | 1 |
999727 | -2 |
992592 | 0 |
992035 | 1 |
992035 | -2 |
986977 | -2 |
986977 | 2 |
936300 | -1 |
Solved! Go to Solution.
Sum count 1 =
VAR _tbl = ADDCOLUMNS(VALUES(Data[Acct #]),"SUM", [Sum Count])
RETURN
CALCULATE([Sum Count],_tbl)
or
Sum count 1 =
VAR _tbl = ADDCOLUMNS(VALUES(Data[Acct #]),"SUM", [Sum Count])
RETURN
sumx(_tbl,[SUM])
Sum count 1 =
VAR _tbl = ADDCOLUMNS(VALUES(Data[Acct #]),"SUM", [Sum Count])
RETURN
CALCULATE([Sum Count],_tbl)
or
Sum count 1 =
VAR _tbl = ADDCOLUMNS(VALUES(Data[Acct #]),"SUM", [Sum Count])
RETURN
sumx(_tbl,[SUM])
CALCULATE(SUM('tabl'[Count]),'tabl'[Count]<0)
Thanks but didn't yield the answer I'm wanting. Sum only if the sum of the count is <0.
User | Count |
---|---|
65 | |
60 | |
47 | |
33 | |
32 |
User | Count |
---|---|
86 | |
75 | |
56 | |
50 | |
45 |