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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
MiloPowerBI
Frequent Visitor

Adding a MIN Filter/Function to Weekly Sales Data

Hello all, 

 

Hoping someone can help me with a little tweak to a measure. 

 

I'm trying to teach myself some DAX and I'm playing with a very small, limited data set. See below. I have other Products but have currently filtered for Laptops. But this every column I have to play with. Very limited!

Table.png

I want to have a Matrix which shows the Weekly Sales (QTY) and below that, the cumulative Sales QTY to date. Like so; 

Matrix.png

This is the measure I'm using to get Cumulative Total; 

Measure.png

This is essentially working fine, until I try and reduce the filter down to show only Weeks 14 and 15 (ie, the two Weeks for Q2). 

I am now getting this; 

MatrixFiltered.png

I'm still getting a running Cumulative Total including the Sales for Weeks 1-13. 

 

Can anyone recommend a way for me to tweak the DAX code above to include some kind of dynamic MIN filter to accompany the MAX function I'm already using?

 

Any advice? Please be gentle, I'm relatively new to all this and just trying to learn!

1 ACCEPTED SOLUTION
Wilson_
Memorable Member
Memorable Member

Hi Milo,

 

By using ALL in your FILTER function, you are ignoring all filter contexts applied to the whole data table. It sounds like you are looking for ALLSELECTED instead.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
MiloPowerBI
Frequent Visitor

Ah, of course. So obvious.....when you know how!

 

Thanks Wilson, that worked a treat. 

Wilson_
Memorable Member
Memorable Member

Hi Milo,

 

By using ALL in your FILTER function, you are ignoring all filter contexts applied to the whole data table. It sounds like you are looking for ALLSELECTED instead.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.