Forum Discussion
Calculate Sum FILTER
- Anonymous4 years ago
Hi dw700d ,
Check the measures.
Include<0:
Measure = CALCULATE(SUM('Table'[AMT]),FILTER(ALLSELECTED('Table'),'Table'[Tract]=BLANK()&&'Table'[loc Cd]=SELECTEDVALUE('Table'[loc Cd])&&LEFT(SELECTEDVALUE('Table'[loc Cd]),1)="Z"))Aggregate value>0:
Measure 2 = var flag = CALCULATE(SUM('Table'[AMT]),FILTER(ALLSELECTED('Table'),'Table'[Tract]=BLANK()&&'Table'[loc Cd]=SELECTEDVALUE('Table'[loc Cd])&&LEFT(SELECTEDVALUE('Table'[loc Cd]),1)="Z")) return IF(flag>0,flag,BLANK())Best Regards,
Jay
Ashish_Mathur I think I realize my issue, I am looking to identify when amt is greater than 0 at the Loc Code level.
So what I am really trying to do is create a measure that gives me the total sum when the Tract column is blank, the Loc Cd begins with Z and the loc Cd is greater than 0 based on the AMT column. Thanks for your help
Hi,
Please take a comprehensive example to pressent your case. Take multiple LocCD's and for those show entries in the Tract numbers as well. On that comprehensive example, show the expected result.
- dw700d4 years ago
Post Patron
Good day Ashish_Mathur see below
Transaction loc Cd AMT Tract 1 Z0000 20 ABC 2 Z1234 100 3 Z1234 -70 4 Z1234 -100 5 Z1234 20 6 Z5678 -50 7 Z5678 -10 8 Z5678 20 9 Z5678 80 10 Z9999 -10 ABC 11 Z9999 30 ABC 12 A1234 20 13 A1234 30 14 Z1111 40 15 Z1111 70 16 Z3333 100 ABC 17 Z3333 20 ABC 18 V1111 -20 19 V1111 -25 20 V1111 50 21 Z8888 50 ABC 22 Z8888 -10 ABC The end result is in the pivot table visual below. It shows Loc Cd's that begin with Z, have a blank in the tract column and the sum of all the individual transactions affilliated with that loc cd is greater than 0
- Ashish_Mathur4 years ago
Super User
Hi,
Here's a simple solution