Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Bruce101995
New Member

Total sum of a average measure

Hello,
I have this measure,I am trying to some the values on the column  € Diferença, but it not right.
Can you help me please?

 

final mesure:

€ Diferença=
 SUMX(VALUES(Calendario[MesNome]),
 [qtd]*[Diff preço real ORCA])


secundary measures 1:

qtd = CALCULATE(SUM('UNION'[Qt Enc Tn]))*1000
secundary measures 2:
Diff preço real ORCA = IF(OR([Real N]= 0, [ORCA N]=0),BLANK(),   [Real N]-[ORCA N])
 
secundary measures 3:
ORCA N =
var yearNE = CALCULATE(MAX(Calendario[Ano]))
var yearN = SELECTEDVALUE(Calendario[Ano],yearNE)
 
var orca_amount_YTD = CALCULATE(AVERAGEX('UNION','UNION'[QTD/valor]), 'Union'[Ano] = yearN && 'Union'[Tipo] = "ORCAMP" && 'UNION'[Uni]="Valor" )
return
orca_amount_YTD
 
secundary measures 4:
Real N =CALCULATE(AVERAGEX('UNION','UNION'[Preço]),'Union'[Tipo] = "Real" )

Note:In the image the total is 288.999€, but if sum the numbers you will see the sum is -119.574€

 

Bruce101995_0-1745420876106.png

 

1 ACCEPTED SOLUTION
johnbasha33
Super User
Super User

@Bruce101995 
€ Diferença =
SUMX(
SUMMARIZE(
Calendario,
Calendario[MesNome],
"Qty", [qtd],
"Diff", [Diff preço real ORCA]
),
[Qty] * [Diff]
)
If you want to go hardcore clean (sometimes better for debugging):

€ Diferença =
VAR _Table =
ADDCOLUMNS(
VALUES(Calendario[MesNome]),
"Qty", [qtd],
"Diff", [Diff preço real ORCA],
"Result", [qtd] * [Diff preço real ORCA]
)
RETURN
SUMX(_Table, [Result])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!



View solution in original post

2 REPLIES 2
Bruce101995
New Member

Thank you, it worked!

johnbasha33
Super User
Super User

@Bruce101995 
€ Diferença =
SUMX(
SUMMARIZE(
Calendario,
Calendario[MesNome],
"Qty", [qtd],
"Diff", [Diff preço real ORCA]
),
[Qty] * [Diff]
)
If you want to go hardcore clean (sometimes better for debugging):

€ Diferença =
VAR _Table =
ADDCOLUMNS(
VALUES(Calendario[MesNome]),
"Qty", [qtd],
"Diff", [Diff preço real ORCA],
"Result", [qtd] * [Diff preço real ORCA]
)
RETURN
SUMX(_Table, [Result])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!



Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors