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

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

Reply
sb991986
Helper I
Helper I

Sumx total in each row & total

Hi,

In the following image, How can i get the total for a new column as 1300 (Sum of 800+500) but individual row as 800, 500 group by header id (see image below)?

sb991986_0-1624029389923.png

 

Thanks in advance!

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @sb991986 ,

 

 

for a measure and also for a calculated column the following formula should work:

 

New Column =
CALCULATE(
    SUM( myTable[Revenue] ),
    ALLEXCEPT( myTable, myTable[Header ID] )
)

 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

7 REPLIES 7
v-xulin-mstf
Community Support
Community Support

Hi @sb991986

 

Try meausre as:

Measure = 
var _sum=
SUMX(
    FILTER(
        ALL('Table'),
        'Table'[Header ID]=MAX('Table'[Header ID])
    ),
    'Table'[Revenue]
)
return 
IF(
    HASONEVALUE('Table'[Revenue]),
    _sum,
    SUM('Table'[Revenue])
    )

Here is the output:

vxulinmstf_0-1624260181559.png

The pbix is attached.

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

selimovd
Super User
Super User

Hey @sb991986 ,

 

 

for a measure and also for a calculated column the following formula should work:

 

New Column =
CALCULATE(
    SUM( myTable[Revenue] ),
    ALLEXCEPT( myTable, myTable[Header ID] )
)

 

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Hi,

In the above example, I would need total as 1300 but individual row as 800, 500 by header id & detail id. Thank you

amitchandak
Super User
Super User

@sb991986 ,

 

calculate(sum(Table[revenue]), allselected(Table))

 

or

 

calculate(sum(Table[revenue]), all(Table))

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

Hi,

In the above example, I would need total as 1300 but individual row as 800, 500 by header id & detail id

@sb991986 , Try like

sumx(values(Table[Header ID]), calculate(sum(Table[revenue]), filter(allselected(Table), Table[Header ID] = max(Table[Header ID]))))

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

I tried your logic but it didn't work. Thank you fro your help

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors