Forum Discussion
Column Totals are not Correct even when using HASONEVALUE()
- 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]
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
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]