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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
aschurf
New Member

How to get sum over multiple rows in power bi?

I'm trying to get the sum of certain lines (revenue) for each of the divisions. That is, I need to take the amount of the division's revenue and use it in another expression.

I tried to use this and it works fine if there is no split into different divisions (Dep1, Dep2, etc)

 

CALCULATE ( SUM([rev]), FILTER ( ALLSELECTED ('table'), 'table'[is_rev] = 1 )))

 

Perhaps there is another solution?

 

2224.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@aschurf , Based on what I got, Try like

CALCULATE ( SUM([rev]), FILTER ( ALLSELECTED ('table'), 'table'[Dept] = max('table'[Dept] ) && 'table'[is_rev] = 1 ))

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@aschurf , Based on what I got, Try like

CALCULATE ( SUM([rev]), FILTER ( ALLSELECTED ('table'), 'table'[Dept] = max('table'[Dept] ) && 'table'[is_rev] = 1 ))

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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!

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