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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
matdub40
Helper III
Helper III

Automatically calculated sum is wrong

Hello,

I have a problem in Power BI that I don't understand.

I have a table Y2_Tarif that contains values like this:

stylecode prix code_tarif
000453-ET1 38,7 T40
000453-ET2 38,7 T40
00091-ET1 34,1 T40

 

I have a first formula which is :
Sum_Price:=CALCULATE(sum(Y2_Tarif[prix]))

And a second one which is: Valo_T40_TY:=([Sum_Price])*(Y2_Sales[TY_Units])
TY_Units is the number of units sold.

Opening my model in Excel or Power BI directly I get this :

 

matdub40_0-1641294541291.png

 

The formula makes me Units * price.
But in the automatically calculated sum I find a huge number which is not the real sum.

For example this with Excel :

 

matdub40_1-1641294558818.png

There should be a sum of 321 639.85€ but I get 46 256 976.99€. Same thing in Power BI:

matdub40_2-1641294576379.png

I don't have many numbers, the sum doesn't add up to 8 108 209.20€. All the other sums are correct, like the Units sum but not this one.

I don't understand how to change this automatically calculated sum. And where can this large value come from? I have looked at my relationships between the tables and they look good.

Thanks for your help

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @matdub40 

Are the two columns you created measures or calculated columns?

You can try this calculated column :

Valo_T40_TY = Y2_Sales[TY_Units]*CALCULATE(SELECTEDVALUE(Y2_Tarif[Sum_Price]))

Original data :

Ailsamsft_0-1641534434962.png

Ailsamsft_1-1641534434963.png

Final result :

Ailsamsft_2-1641534434966.png

I have attached my pbix file , you can refer to it .

As for the three functions you mentioned, you can refer to the document I provided, which explains the three functions in detail.

https://radacad.com/sum-vs-sumx-what-is-the-difference-of-the-two-dax-functions-in-power-bi

https://dax.guide/hasonefilter/

https://community.powerbi.com/t5/Desktop/HASONEFILTER-in-DAX/m-p/453866

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @matdub40 

Are the two columns you created measures or calculated columns?

You can try this calculated column :

Valo_T40_TY = Y2_Sales[TY_Units]*CALCULATE(SELECTEDVALUE(Y2_Tarif[Sum_Price]))

Original data :

Ailsamsft_0-1641534434962.png

Ailsamsft_1-1641534434963.png

Final result :

Ailsamsft_2-1641534434966.png

I have attached my pbix file , you can refer to it .

As for the three functions you mentioned, you can refer to the document I provided, which explains the three functions in detail.

https://radacad.com/sum-vs-sumx-what-is-the-difference-of-the-two-dax-functions-in-power-bi

https://dax.guide/hasonefilter/

https://community.powerbi.com/t5/Desktop/HASONEFILTER-in-DAX/m-p/453866

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you very much @Anonymous  for your explanations, it solved my problem!

amitchandak
Super User
Super User

@matdub40 , If they are from same table . Try a measure like

 

Valo_T40_TY:=sumx(Y2_Sales,[Y2_Sales[Price]*Y2_Sales[TY_Units])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak,

 

No, there is the Y2_Sales table which contains the value "TY_Units" and the Y2_Tarif which contains the value "prix"

@matdub40 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



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  I have read the information contained in the two links you sent me, so for my problem concretely I must do what? HASONEFILTER, SUMX, SUM ? I'm a bit lost...

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.