Forum Discussion
PSampras
3 years agoFrequent Visitor
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],[ImpNett...
- 3 years ago
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:
Greg_Deckler
3 years agoCommunity 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
hnguy71
3 years agoSuper 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:
- PSampras3 years agoFrequent 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))- hnguy713 years agoSuper User
hehee, i'm glad it worked out! Enjoy!