Forum Discussion
Need Help Summing a Total
IamTDR You could try this measure:
PIU =
VAR _min =
MIN ( Test_Data[PIU] )
VAR _max =
MAX ( Test_Data[PIU] )
VAR _same = _min = _max
RETURN
IF ( _same, _min, _min + _max )
This worked on my small sample data, but when I tried to use in my BI report I receive a "The end of the input was reached" message.
- DataZoe5 years agoMicrosoft Employee
IamTDR hmm, not really sure why that error would show as it's usually syntax error. Maybe there are blanks in the bigger set?
PIU =
VAR _min =
MIN ( Test_Data[ProgramAdmissions] )
VAR _max =
MAX ( Test_Data[ProgramAdmissions] )
VAR _same =
IF ( ISBLANK ( _min ), FALSE (), _min = _max )
RETURN
IF ( _same, _min, _min + _max )- IamTDR5 years agoResponsive Resident
Sorry, I still had the same error. My dataset is large with many accounts and program codes. Maybe thats my issue?
- IamTDR5 years agoResponsive Resident
First thanks for the feedback.
I am attempting to sum my PIU number but this number should be summed by AcctNumber and ProgramCode.
In the example picture, the sum should be 711.
Should I create a concatenate of accountnumber and programcode and use that field to sum my PIU?- DataZoe5 years agoMicrosoft Employee
IamTDR This is a bit different than the Test_Data 🙂 Try this measure:
PIU 2 =
VAR _t =
SUMMARIZE (
Test_Data,
Test_Data[AccountNumber],
Test_Data[ProgramCode],
"PIU", MIN ( [ProgramAdmissions] )
)
VAR _d =
SUMX ( _t, VALUE ( [PIU] ) )
RETURN
_d- IamTDR5 years agoResponsive Resident
Thank you! The lastest measure, PIU2 worked!
Thanks again!