cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent 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],[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

1 ACCEPTED SOLUTION
Memorable Member

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 4
Super User

@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

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Memorable Member

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:

Frequent Visitor

Thank you very much @hnguy71 , it works!

`#Delta = VAR _Actual = SUM(vods_facAgr_ITA[ImpNetto]) // replace this with the sum of your actualsVAR _Budget = SUM(vods_facAgr_ITA[ColBudgetRigaClassificatore]) // replace this with the sum of your budgetVAR _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 HASONEFILTERIF( HASONEFILTER(vods_facAgr_ITA[Classificatore]), if(isblank(_Delta),1,_Delta), DIVIDE(_Actual - _Budget, _Budget))`
Memorable Member

hehee, i'm glad it worked out! Enjoy!

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.