Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |