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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
pietshort
Frequent Visitor

Filter out the last three known weeks and the total of all weeks does not decrease

Example Table 1:

Column AColumn B
Week 12
Week 25
Week 34
Week 43

Week 5

1

Week 6

4


In table 1 I want to perform a filtering. Column A contains the weeks (alpha number, no time intelligence) and column B contains the values. If I filter by column A on the text value week 1, week 2, week 3, I want week 4 to add these values from week 1t/m3. So that the volume does not decrease in the weeks but in the "visual" the weeks are no longer visible.

Outcome of Table 2:

 

Column AColumn B
Week 414

Week 5

15

Week 6

19


In the end, I want a meausure to filter out the last three known weeks and the total of all weeks does not decrease. Like Table 2 above.

 

Thank you in advanced 

1 ACCEPTED SOLUTION

Hi, @pietshort 

 

You can try the following methods.

Measure = CALCULATE(SUM('Table'[ColumnB]),FILTER(ALL('Table'),[ColumnA]<=SELECTEDVALUE('Table'[ColumnA])))

vzhangti_0-1698140232775.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @pietshort 

 

You can try the following methods.

ColumnC = CALCULATE(SUM('Table'[ColumnB]),FILTER('Table',[ColumnA]<=EARLIER('Table'[ColumnA])))

vzhangti_0-1698027940794.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Hi Charlotte,

 

This is the solution in a calculated column but i would like to have it in a measure.

Hi, @pietshort 

 

You can try the following methods.

Measure = CALCULATE(SUM('Table'[ColumnB]),FILTER(ALL('Table'),[ColumnA]<=SELECTEDVALUE('Table'[ColumnA])))

vzhangti_0-1698140232775.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.