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! Learn more

Reply
PBINewbie920
Helper I
Helper I

Caluculate sum with 2 filters

Hi! 

 

I'm trying to create a measure like this: In this situation I want it to show the total value, regardless of the month (or any date filters on the page) and show for each location. This issue im having is with the "total" field:

PBINewbie920_0-1652384005648.png

 

I've tried a few different equations and can only get it to work when I add "min" and "max, but that obviously created problems with the totals (with min it takes the first value, with max it takes the last) Is there a way to get this equation to work without min/max or to get the total to actually add up?

 

Thanks!!

 

Formula1 =
CALCULATE (
SUM ( 'ALL Sources'[Total $] ),
FILTER (
ALL ( 'All Sources' ), 'ALL Sources'[Date] &&
'ALL Sources'[Location] = MAX ( 'ALL Sources'[Location] )
)
)
 
Formula2 =
CALCULATE (
SUM ( 'ALL Sources'[Total $] ),
FILTER (
ALL ( 'All Sources' ), 'ALL Sources'[Date] &&
'ALL Sources'[Location] = MIN ( 'ALL Sources'[Location] )
)
)

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @PBINewbie920,

You can try to use the following measure formula to calculate the summary values based on 'location' and 'date' groups:

Formula1 =
CALCULATE (
    SUM ( 'ALL Sources'[Total $] ),
    ALLSELECTED ( 'All Sources' ),
    VALUES ( 'ALL Sources'[Date] ),
    VALUES ( 'ALL Sources'[Location] )
)

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI @PBINewbie920,

You can try to use the following measure formula to calculate the summary values based on 'location' and 'date' groups:

Formula1 =
CALCULATE (
    SUM ( 'ALL Sources'[Total $] ),
    ALLSELECTED ( 'All Sources' ),
    VALUES ( 'ALL Sources'[Date] ),
    VALUES ( 'ALL Sources'[Location] )
)

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@PBINewbie920 , try measures like

 

Grand Total =
CALCULATE (
SUM ( 'ALL Sources'[Total $] ),
FILTER (
ALL ( 'All Sources' )
))


Location wise total =
CALCULATE (
SUM ( 'ALL Sources'[Total $] ),
FILTER (
ALL ( 'All Sources' ),
'ALL Sources'[Location] = MAX ( 'ALL Sources'[Location] )
)
)

or


Grand Total =
CALCULATE (
SUM ( 'ALL Sources'[Total $] ),
FILTER (
ALLSELECTED ( 'All Sources' )
))


Location wise total =
CALCULATE (
SUM ( 'ALL Sources'[Total $] ),
FILTER (
ALLSELECTED ( 'All Sources' ),
'ALL Sources'[Location] = MAX ( 'ALL Sources'[Location] )
)
)

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
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!

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.

Top Solution Authors
Users online (2,341)