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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
achrafkasmi
Helper I
Helper I

calculate the SUM of a mesure ( urgent )

Hello,

 

i have a table named "V_QTSDAMA" and I have a column named "ItemName"  with a repeating products with its own stock.

 

I need to calculate the sum of " BESOIN PF " for each product. ( to not to have the products repeating themselves)

 

PS : note that the column "BESOIN PF" it's calculated as a Mesure.

 

- i work on a directquery Mode.

 

achrafkasmi_0-1676017099680.png

 

 

For exemple this is result that I want  , i made it on excel : 

 
 

achrafkasmi_1-1676017099978.png

 

 

Thanks, 

 

ACHRAF KASMI

 
2 REPLIES 2
achrafkasmi
Helper I
Helper I

hello, @v-zhangti , thanks for your answer ,

 

the measure " besoin en rpm " is not the same as " besoin PF ".

 

the need in finished product is in red " besoin PF " that is to say to produce it I need a calculation of the sum of the raw materials " besoin en rpm ".

 

achrafkasmi_0-1676283758708.png

I’ll show you the result that i want on excel : 

achrafkasmi_1-1676284526664.png

So if I can summarize, we’ll consider the MESURE "BESOIN PF" as a positive values i need to calculate the SUM for each ItemName.

 

thanks,

v-zhangti
Community Support
Community Support

Hi, @achrafkasmi 

 

You can try the following methods.
BESOIN PF is a measure.

Besoin on RPM = ABS('Table'[BESOIN PF])
Besoin Total = SELECTEDVALUE('Table'[StockMP])-[Besoin on RPM]

vzhangti_0-1676257159285.png

CodeBom 91000915 [Besoin on RPM] Sum is 515, not 396.

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.