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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Want to return the single value.

Hi, Everyone

 

I have question please help.

 

I want to return the Total Amount from each Sale Order No. and want the value to be the same for all 3 Rows, which is based on the Account Code number = 60105001.


Expected results
Returns Total Amount = 72,900.00 for all 3 Rows.

 

How do I write the formula?

 

ihave1question_0-1711423439372.png

 

1 ACCEPTED SOLUTION

I suspect the issue here is that you have other sale order numbers that you don't want included in your formula.  We just need another variable to handle that.

TotalAmount from AccCode = var AccountCode = "60105001"
var SaleOrder = [Sale Order No.]
var output = CALCULATE(
    SUM('Reconcile Back Order'[Total Amount]),
    ALL('Reconcile Back Order'),
    'Reconcile Back Order'[Account Code] = AccountCode,
    'Reconcile Back Order'[Sale Order No.] = SaleOrder
)
RETURN
output

View solution in original post

6 REPLIES 6
RossEdwards
Solution Sage
Solution Sage

Try the below.  I didn't know your table's name, so i have called it "YourTable"

TotalAmount from AccCode = var AccountCode = [Account Code]
var output = CALCULATE(
    SUM('YourTable'[Total Amount]),
    ALL('YourTable'),
    'YourTable'[Account Code] = AccountCode
)
RETURN
output

 

Anonymous
Not applicable

The value obtained is a sum of sums, still not what I want.

 

What I want is for all 3 Rows. to have the same value: 72,900.00, which is based on Account = 60105001 as shown in the picture above.

 

Can you help me again?

 

Write formula

ihave1question_0-1711425447034.png

 

Result formula

ihave1question_1-1711425629340.png

 

Oh thats an easy fix then.  In the code sample I provided to you.  Change the AccountCode variable to a static account code rather than the dynamic one. 

From

var AccountCode = [Account Code]

to

var AccountCode = "60105001"

 

Anonymous
Not applicable

I have made the correction. The results obtained It's still not what you want.

 

But what I got is It's the same result for all 3 rows. I think I'm close to getting the correct answer. If the answer is 72,900.00 then it is correct.

 

Write formula

ihave1question_0-1711426156457.png

 

Result formula

ihave1question_1-1711426194443.png

I suspect the issue here is that you have other sale order numbers that you don't want included in your formula.  We just need another variable to handle that.

TotalAmount from AccCode = var AccountCode = "60105001"
var SaleOrder = [Sale Order No.]
var output = CALCULATE(
    SUM('Reconcile Back Order'[Total Amount]),
    ALL('Reconcile Back Order'),
    'Reconcile Back Order'[Account Code] = AccountCode,
    'Reconcile Back Order'[Sale Order No.] = SaleOrder
)
RETURN
output
Anonymous
Not applicable

The results were as expected.

 

Write formula

ihave1question_1-1711427191571.png

 

Result formula

ihave1question_0-1711427109373.png

 

Very Thankful.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors