Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello!
I need the amount (sum) by name without a negative amount (sum) or a without positive amount (sum).
For example:
№ name Value
1 Com1 200
2 Com1 300
3 Com2 500
4 Com2 -200
5 Com3 -500
6 Com3 300
Result:
//Without negative value № name Value 1 Com1 500 2 Com2 300 //Without positive value № name Value 1 Com3 -200
Thanks for all!
Hi,
This should be -
positivevalues = calculate(sum([value]),filter(tablename,[value]>0))
negativevalues = calculate(sum([value]),filter(tablename,[value]<0))
This can also be achieved with the visual level filters, unless you need to show both on the same visual.
Rob
Hi @Anonymous
You could try two calculated measures
Positive = VAR x =SUM(Table1[VAlue]) RETURN IF(x>=0,x)
and
Negative = VAR x =SUM(Table1[VAlue]) RETURN IF(x<0,x)
If you drag these measures to their own visuals along with the [name] field you get the following.
It's good idea, sorry but I'm using formula for calculate like this:
var corrected = IF(MIN('Calendar'[Date]) <= CALCULATE(MAX('Table'[Date]), ALL('Table')), CALCULATE(SUM('Table'[Value]), FILTER(ALL('Calendar'), 'Calendar'[Date] <= MAX('Calendar'[Date])))) return //other formula + corrected
so, I need measure with that formula. Thanks for all!
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |