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
Powers
Helper I
Helper I

How to calculate sum of amount where orderdate between Max of date

 
4 REPLIES 4
Anonymous
Not applicable

Hi @Powers 

 

Thank you very much amitchandak for your prompt reply.

 

Have you solved your problem? If you haven't already, here are some ways to do it:

 

"Order Table"

vnuocmsft_0-1728010768851.png

 

"Date"

 

Date = CALENDAR("9/10/2024", "10/5/2024")

vnuocmsft_1-1728010816507.png

 

Create a measure.

 

Amount Total = 
var _MaxDate = MAX('Date'[Date])
var _MinDate = MIN('Date'[Date])
RETURN
CALCULATE(
    SUM('Order Table'[Amount]),
    FILTER(
        ALL('Order Table'),
        'Order Table'[OrderDate] >= _MinDate
        &&
        'Order Table'[OrderDate] <= _MaxDate
    )
)

 

Here is the result.

vnuocmsft_2-1728010861162.png

If you still have problems, it is best to provide the pbix file and be careful to delete sensitive data.

 

Regards,

Nono Chen

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

 

Hi @Anonymous, Thanks for your reply. Can you please find the below post?. In the below post I have mentioned the requirement and as well as the sample data.
I am looking for the solution for the below post. If you can solve the below problem then it will be great.

https://community.fabric.microsoft.com/t5/Desktop/How-to-calculate-sum-of-Product-purchase-Sold-between-Min-and/m-p/4215761


Best Regards,
Powers

amitchandak
Super User
Super User

@Powers , you need to have a measure like

 

Only In Min Max Month =
var _min = minx(allselected('Date'), 'Date'[Date])
var _max = maxx(allselected('Date'), 'Date'[Date])
return
CALCULATE(sum('Table'[Qty]), FILTER('Date',eomonth('Date'[Date],0) = eomonth(_min, 0) && eomonth('Date'[Date],0) =eomonth(_max, 0)))

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 @amitchandak,

Thanks for your reply. I have tried your solution but it's not working.

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!

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.