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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SIMMI
Frequent Visitor

Filtered table sum

Hi,

 

I was trying to get the sum of all the values recorded in the past 24 months. My knowledge with DAX is very basic. I have applied filters, but it's working at each row level. I want the filters to be applied at the table level. What I'm getting currently is:

SIMMI_0-1674041915967.png

whereas what I'm looking for is:

RaisedDateClosedDateMonthSummaryValueTEST
01/01/202005/01/202001/01/202010
02/02/202002/02/202001/02/202031
03/03/202003/03/202001/03/202024
04/03/202001/04/202001/04/202046
01/01/202010/04/202001/04/202026
05/06/202005/06/202001/06/2020212
01/01/202102/01/202101/01/2021314
01/05/202102/05/202101/05/2021217
06/06/202101/08/202101/08/2021419
02/01/202203/01/202201/01/2022223
03/03/202203/03/202201/03/2022321
04/04/202204/04/202201/04/2022222

 

Kindly help.

 

Thanks.

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @SIMMI 

Thanks for the sample data you provide.

Here are the steps you can refer to :
(1)My test data is the same as yours.

(2)We can create a measure like this:

Measure = var _cur_month = MAX('Table'[MonthSummary])
var _pre_24month = EOMONTH(_cur_month,-25)
var _t = FILTER( ALLSELECTED('Table') ,'Table'[MonthSummary]>_pre_24month && 'Table'[MonthSummary]< _cur_month)
return
SUMX(_t , [Value])+0

(3)Then we can meet your need:

vyueyunzhmsft_0-1674098945066.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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-yueyunzh-msft
Community Support
Community Support

Hi , @SIMMI 

Thanks for the sample data you provide.

Here are the steps you can refer to :
(1)My test data is the same as yours.

(2)We can create a measure like this:

Measure = var _cur_month = MAX('Table'[MonthSummary])
var _pre_24month = EOMONTH(_cur_month,-25)
var _t = FILTER( ALLSELECTED('Table') ,'Table'[MonthSummary]>_pre_24month && 'Table'[MonthSummary]< _cur_month)
return
SUMX(_t , [Value])+0

(3)Then we can meet your need:

vyueyunzhmsft_0-1674098945066.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

Mahesh0016
Super User
Super User

@SIMMI can you Share the Sheet1 Data.

RaisedDateClosedDateMonthSummaryValue
01/01/202005/01/202001/01/20201
01/01/202010/04/202001/04/20202
02/02/202002/02/202001/02/20203
03/03/202003/03/202001/03/20202
04/03/202001/04/202001/04/20204
05/06/202005/06/202001/06/20202
01/01/202102/01/202101/01/20213
01/05/202102/05/202101/05/20212
06/06/202101/08/202101/08/20214
02/01/202203/01/202201/01/20222
03/03/202203/03/202201/03/20223
04/04/202204/04/202201/04/20222

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.