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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
alvinlinjr
New Member

An alternative way to sum values for a specified date range?

Hello community! I created this measure to sum total savings between two dates, [Monthly Updated Transition Date] & [End Transition Date], using an IF statement:

 

 

JUL Savings = 
IF(DATE(2022, 7, 1) >= MIN('Project Data'[Monthly Updated Transition Date]) && DATE(2022, 7, 1) < MIN('Project Data'[End Transition Date]),    
        SUMX(VALUES('Project Data'[Concatenate]),
            CALCULATE(SUM('Query_Sums'[JUL ]) * SUM('Project Data'[Savings per SKU (per actual case)]))
        ),
    BLANK()
 )

 

 

 

While this evaluates a result for each Project Name, it does not evaluate a Total in the matrix visual:

Presentation1.png

 Are there other ways to re-write the DAX, such as by using ISONORAFTER? Thanks so much for your help in advance!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @alvinlinjr 

Please try

JUL Savings =
SUMX (
VALUES ( 'Project Data'[Concatenate] ),
CALCULATE (
IF (
DATE ( 2022, 7, 1 ) >= MIN ( 'Project Data'[Monthly Updated Transition Date] )
&& DATE ( 2022, 7, 1 ) < MIN ( 'Project Data'[End Transition Date] ),
SUM ( 'Query_Sums'[JUL ] )
* SUM ( 'Project Data'[Savings per SKU (per actual case)] ),
BLANK ()
)
)
)

View solution in original post

2 REPLIES 2
alvinlinjr
New Member

Works perfectly - thanks so much, @tamerj1 !

tamerj1
Super User
Super User

Hi @alvinlinjr 

Please try

JUL Savings =
SUMX (
VALUES ( 'Project Data'[Concatenate] ),
CALCULATE (
IF (
DATE ( 2022, 7, 1 ) >= MIN ( 'Project Data'[Monthly Updated Transition Date] )
&& DATE ( 2022, 7, 1 ) < MIN ( 'Project Data'[End Transition Date] ),
SUM ( 'Query_Sums'[JUL ] )
* SUM ( 'Project Data'[Savings per SKU (per actual case)] ),
BLANK ()
)
)
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.