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
jrobb
New Member

Measure to capture MAX value based on filter selections

Hello,
 
I am a somewhat newbie to power BI and DAX, and trying to muddle my way through a particular issue.
 
I have a report set-up that displays a chart with Forecasted Sales $ over time.  I also have a filter for users to choose the specfic date(s) for which they want to display the data ("DateStamp").
 
I am trying to create a measure that will display the Total Sales $ value, of the Maximum selected DateStamp (latest date).  However, the result I am getting is a total of ALL Cumulative Sales $, for ALL date stamps selected. 
 
Do I have an error in my DAX statement? 
 
EndingCUM_ForMaxDtStamp = CALCULATE(SUM(FCST[FCST_Sales$]),
FILTER(FCST,FCST[DateStamp]=CALCULATE(MAX(FCST[DateStamp]),ALLSELECTED((FCST[DateStamp]))))
 
 
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @jrobb 

 

Try this measure:

EndingCUM_ForMaxDtStamp =
VAR _Max_Date =
    MAX ( FCST[DateStamp] )
RETURN
    CALCULATE (
        SUM ( FCST[FCST_Sales$] ),
        KEEPFILTERS ( FCST[DateStamp] = _Max_Date )
    )

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

View solution in original post

2 REPLIES 2
VahidDM
Super User
Super User

Hi @jrobb 

 

Try this measure:

EndingCUM_ForMaxDtStamp =
VAR _Max_Date =
    MAX ( FCST[DateStamp] )
RETURN
    CALCULATE (
        SUM ( FCST[FCST_Sales$] ),
        KEEPFILTERS ( FCST[DateStamp] = _Max_Date )
    )

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

This worked perfectly.  Thanks @VahidDM !

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

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!

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.

Users online (25)