Forum Discussion

Roseventura's avatar
Roseventura
Icon for Responsive Resident rankResponsive Resident
7 years ago
Solved

Column Totals are not Correct even when using HASONEVALUE()

I need to understand why my measures in columns 2 and 4 are not totalling correctly.    Here is my table. Here are the measures for each column:   COLUMN 1: Total Credit Adjustment =    ...
  • Roseventura's avatar
    Roseventura
    7 years ago

    I discovered that the MAX function in my original TOTAL CREDIT ADJUSTMENT measure was the culprit.  Here's the original measure:

     

    Total Credit Adjustment =
           IF(MAX(PBI_FSCAPF[PADFMO]) =3 ||MAX(PBI_FSCAPF[PADFMO]) =6 || MAX(PBI_FSCAPF[PADFMO]) =9  ||

               MAX(PBI_FSCAPF[PADFMO]) =12 ,-375000,-300000)

     

    This was an issue in the total, because the MAX results is always calculating to 12 and therefore 375,000 * 3 = 1,125,000 (which was the incorrect total I was getting).  As soon as I removed MAX() it worked and I didn't have to use a HASONEVALUE branch measure.  This corrected measure gave me the results I wanted:

     

    Total Credit Adjustment = SUMX( VALUES( PBI_FSCAPF[PADFMO] ),IF(PBI_FSCAPF[PADFMO] =3 || PBI_FSCAPF[PADFMO] = 6 || PBI_FSCAPF[PADFMO] =9 || PBI_FSCAPF[PADFMO] =12 ,-375000,-300000))

     

    This change makes the other “branched” measure work:

     

    Credit Adjusment Less Inv Credits = [Total Credit Adjustment]-[Total Inv Credits]

    capture2