Forum Discussion
Measure Total value: change the default behaviour
Hi everyone,
i have a problem with a total value of a measure.
"Δ su Budget" measure value is correct in row context.
Δ su Budget = divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp])
Total column is calculated as average of row's measure value (175,93 %)
There is a way to calculate total with the same row logica?
I want: (1.328.128,36 - 1.145.231,18) / 1.145.231,18 = 0,1597 (15,97 % in percentage).
Thanks for the help!!
Giuseppe
PSampras ,
You may be able to get it using a similar fashion:
#Delta = VAR _Actual = SUM('Table'[Actual]) // replace this with the sum of your actuals VAR _Budget = SUM('Table'[Budget]) // replace this with the sum of your budget VAR _Delta = SUM('Table'[Delta]) // replace this with your current measure --> divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp]) RETURN // I selected classification but this value should be on your table somewhere. You can also interchange and use ISINSCOPE instead of HASONEFILTER IF( HASONEFILTER('Table'[Classification]), _Delta, DIVIDE(_Actual - _Budget, _Budget))Here's an example output:
4 Replies
- Greg_DecklerCommunity Champion
PSampras 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- hnguy71Super User
PSampras ,
You may be able to get it using a similar fashion:
#Delta = VAR _Actual = SUM('Table'[Actual]) // replace this with the sum of your actuals VAR _Budget = SUM('Table'[Budget]) // replace this with the sum of your budget VAR _Delta = SUM('Table'[Delta]) // replace this with your current measure --> divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp]) RETURN // I selected classification but this value should be on your table somewhere. You can also interchange and use ISINSCOPE instead of HASONEFILTER IF( HASONEFILTER('Table'[Classification]), _Delta, DIVIDE(_Actual - _Budget, _Budget))Here's an example output:
- PSamprasFrequent Visitor
Thank you very much hnguy71 , it works!
#Delta =
VAR _Actual = SUM(vods_facAgr_ITA[ImpNetto]) // replace this with the sum of your actuals
VAR _Budget = SUM(vods_facAgr_ITA[ColBudgetRigaClassificatore]) // replace this with the sum of your budget
VAR _Delta = divide(sum(vods_facAgr_ITA[ImpNetto])-sum(vods_facAgr_ITA[ColBudgetRigaClassificatore]),sum(vods_facAgr_ITA[ColBudgetRigaClassificatore])) // replace this with your current measure --> divide(sum(FACT_PL_FATTURATO[IMPNETTO])-[ImpNettoAp],[ImpNettoAp])
RETURN
// I selected classification but this value should be on your table somewhere. You can also interchange and use ISINSCOPE instead of HASONEFILTER
IF( HASONEFILTER(vods_facAgr_ITA[Classificatore]), if(isblank(_Delta),1,_Delta), DIVIDE(_Actual - _Budget, _Budget))