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

Reply
Powers
Helper I
Helper I

How to calculate sum of Product purchase Sold between Min and Max of Snapshotdate and Monthyear

 
3 REPLIES 3
Anonymous
Not applicable

Hi @Powers ,

 

If you want to create a table visual return this result, I think you don't need to create a measure.

You just need to add the columns into the table visual. Here I my sample based on your data.

vrzhoumsft_0-1728025888701.png

If this still couldn't help you solve your issue, I need more details. 

What does [MonthYear] mean in your table? I see this column only returns 2024/09/01, in august or july data.

And [SNAPSHOTDATE] will only return 2024/09/17 in your sample. I think min or max of them doesn't make sense.

Please share a sample file with us and show us a screenshot with the result you want.

 

Best Regards,
Rico Zhou

 

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

 

Kedar_Pande
Super User
Super User

Updated Measure:

LaptopSold_Monthwise =
VAR MAXDATE = MAX('Product Data'[SNAPSHOTDATE])
VAR MINDATE = MIN('Product Data'[MONTHYEAR])
RETURN
CALCULATE(
SUM('Product Data'[PRODUCTCOUNT]),
'Product Data'[SNAPSHOTDATE] = MAXDATE,
DATESBETWEEN('Product Data'[PRODUCTPURCHASEDATE], MINDATE, MAXDATE),
'Product Data'[PRODUCTTYPE] = "Laptop",
REMOVEFILTERS('Product Data'[MONTHYEAR]) // Remove the filter context from MonthYear to prevent mismatches
)

If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande

Hi @Kedar_Pande , Thanks for your reply. I have already tried with Removefilters [Monthyear] and I have also applied keepfilters on Productstartmonth column but still that's not giving the expected output.  I have also used filter function with ALL and ALLSELECTED functions but still that is givinng me the same result. but that is not helping me to achieve the expected output.

I have tried with filter modified functions like ALL, ALLSELECTED, REMOVEFILTERS, KEEPFILTERS, FILTER functions and still I am not getting the expected output.

Best Regards,
Powers

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI 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.

Top Solution Authors