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

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

Reply
Anonymous
Not applicable

How to make the total amount display correctly ?

Hi All

 
My AMT_OH field expression :-
AMT_OH = SUM(INVC[Unit Cost])*SUM(INVC[Avail])
 

Paulyeo11_0-1607134009168.png

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Based on your description, you can modify the measure like this:

AMT_OH =
VAR tab =
    SUMMARIZE (
        'Table',
        'Table'[Stock Code],
        'Table'[Unit Cost],
        'Table'[Avail],
        "RE", SUM ( 'Table'[Unit Cost] ) * SUM ( 'Table'[Avail] )
    )
RETURN
    SUMX ( tab, [RE] )

sum.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
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
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

Based on your description, you can modify the measure like this:

AMT_OH =
VAR tab =
    SUMMARIZE (
        'Table',
        'Table'[Stock Code],
        'Table'[Unit Cost],
        'Table'[Avail],
        "RE", SUM ( 'Table'[Unit Cost] ) * SUM ( 'Table'[Avail] )
    )
RETURN
    SUMX ( tab, [RE] )

sum.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you very much , i unable to understand your script. can you explain a bit ?

Hi @Anonymous ,

Sure. The variable extract the source table and add a new column for it to calculate [unit cost] * [avil] for current context, it could be more simple like this:

a =
ADDCOLUMNS ( 'Table', "RE", [Unit Cost] * [Avail] )

You can use the above formula to replace the variable and create a new calculated table to check which value it returns that should be the same as the initial formula.

For SUMX(), calculate the sum value for the field in the variable table which should be look like the same as the initial table and you will get the expected output.

 

In addition, you can refer these documents about the dax functions that I quoted:

  1. SUMX() 
  2. SUMMARIZE() 
  3. ADDCOLUMNS() 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Ying

 

Thank you for your detail expliantion .

 

For below expressoin "RE" , i search high and low unable to fine RE.

a = ADDCOLUMNS ( 'Table', "RE", [Unit Cost] * [Avail] )

Hi @Anonymous ,

Whether using Addcolumns() or Summarize() to create a calculated table, you can find it, it stores as a variable column and could be any name like "AAA","BBB","CCC" etc.

t.png

Back to the initial measure, summarize() is better in this case because addcolumns() will calculate the wrong total value comparing with the context of the source table although both of these functions can return the same value in calculated table.

AMT_OH = 
VAR tab =
    SUMMARIZE (
        'Table',
        'Table'[Stock Code],
        'Table'[Unit Cost],
        'Table'[Avail],
        "RE",  [Unit Cost]  * [Avail] 
    )
RETURN
    SUMX ( tab, [RE] )

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , They are from same table try like

AMT_OH = SUMX(INVC, INVC[Unit Cost])*SUM(INVC[Avail])

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.