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
Anonymous
Not applicable

DAX - Value above threshold 3 months in a row while filtering

To illustrate my problem, I'm trying to get a list of the people who have a score above 80 for 3 months in a row.

So from the table below, there would be J in my list but not M.

 

NAME

DATE

SCORE

J

MAR 2022

90

J

APR 2022

92

J

JUN 2022

98

M

MAR 2022

90

M

APR 2022

45

M

JUN 2022

92

 

My idea was to create a new colomn which tells me if the person scored above 75 the previons month and the month before that using CALCULATE and DATEADD. However, I don't know how I can first filter only on names?

 

I tried:

3-month =

VAR name= table[NAME] RETURN

IF(

AND(

AND(table[SCORE]>75,

CALCULATE(AVERAGE(table[SCORE]),table[NAME]=ope, DATEADD(table[DATE].[Date],-1,MONTH))>0.75),

CALCULATE(AVERAGE(table[SCORE]),table[NAME]=name, DATEADD(table[DATE].[Date],-2,MONTH))>0.75),

"3m > 75",

"")

 

How can I create this column?

Thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , a new column like

new column =
var _1 = eomonth([Date],-1)
var _2 = eomonth([Date],-2)
var _lastm = sumx(filter(Table, [Name] = earlier([Name]) && eomonth([Date],0) =_1),[Score])
var _lastm2 = sumx(filter(Table, [Name] = earlier([Name]) && eomonth([Date],0) =_1),[Score])
return
if(_lastm >75 && _lastm2 >75, 1, 0)

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

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , a new column like

new column =
var _1 = eomonth([Date],-1)
var _2 = eomonth([Date],-2)
var _lastm = sumx(filter(Table, [Name] = earlier([Name]) && eomonth([Date],0) =_1),[Score])
var _lastm2 = sumx(filter(Table, [Name] = earlier([Name]) && eomonth([Date],0) =_1),[Score])
return
if(_lastm >75 && _lastm2 >75, 1, 0)

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
Anonymous
Not applicable

Thank you, it worked perfectly!

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