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
DanCasSan
Helper V
Helper V

Filter that does not affect calculated measure

Hello community.

 

I have a formula that calculates the purchase value; however, within that calculation I am telling you to only consider the month of December. I also have several segmenters that I use as a filter such as year and month, and when I select a month other than December, I get 0 in my formula.

 

DAX formula:

Purchase value LP = CALCULATE ([Purchase value], DATEADD (Calendar [Date], - 1, YEAR), Calendar [Month No.] = 12)

 

I need to do the following:

1. If a closed or finished year is selected, you should always take the data for the month of December of the previous year.
2. When filtering any month from the segmenter, the measure must not change, it must remain fixed with the month of December of the previous year.

 

I thank you in advance for your support.

 

Reggards,

DC

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@DanCasSan, if there are any other filter that can delete month, then you may not get data for dec ,

You can get the last month of last year as

example: date is my calendar table

el año pasado el pasado MTD Ventas ?
var _max á datediff(startofyear('Date'[Date],"12/31"), maxx(allselected('Date'), 'Date'[Date]),month)
devolución
CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1*_max,MONTH)))

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@DanCasSan, if there are any other filter that can delete month, then you may not get data for dec ,

You can get the last month of last year as

example: date is my calendar table

el año pasado el pasado MTD Ventas ?
var _max á datediff(startofyear('Date'[Date],"12/31"), maxx(allselected('Date'), 'Date'[Date]),month)
devolución
CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1*_max,MONTH)))

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

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
Top Kudoed Authors