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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measure to see if the previous date is greater then 3 months based on id

Hi Experts

 

need a measure that would count where a Date had been extended out by more then 3 months where issues ID has remained the same in the second column. 

DATE              ISSUE ID          Result

01/01/21        50

01/05/21        50                    Extended

01/02/21        25

01/03/21        25                    No Change

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try measure like

 

if( datediff(Max(Table[Date]) , MAXX(filter(allselected(Table), Table[ID] = Max(Table[ID]) && Table[Date] < Max(Table[Date])),[Date]), month) >4, "Extended", "No Change")

View solution in original post

2 REPLIES 2
RohiniP-26
Resolver I
Resolver I

@Anonymous 

you can try this dax

 

result =
IF(ISBLANK(CALCULATE(MAX(Sheet1[Date]),FILTER(Sheet1,Sheet1[Issue id]=EARLIER(Sheet1[Issue id]) && Sheet1[Date]<EARLIER(Sheet1[Date])))), BLANK(),
IF(DATEDIFF(CALCULATE(MAX(Sheet1[Date]),FILTER(Sheet1,Sheet1[Issue id]=EARLIER(Sheet1[Issue id]) && Sheet1[Date]<EARLIER(Sheet1[Date]))), Sheet1[Date],
MONTH
)>3,
"EXTENDED",
"NO CHANGE"
)
)
 
If you want to count all issue id which are extended then use below measure,
count = CALCULATE(COUNT(Sheet1[result]),FILTER(Sheet1,Sheet1[result]="EXTENDED"))
 
 
If this post helps you mark it as 'Accept as solution' below
amitchandak
Super User
Super User

@Anonymous , Try measure like

 

if( datediff(Max(Table[Date]) , MAXX(filter(allselected(Table), Table[ID] = Max(Table[ID]) && Table[Date] < Max(Table[Date])),[Date]), month) >4, "Extended", "No Change")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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