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
Twe-Maker
Frequent Visitor

DAX to find all inactive id in 3 month

DAX to find all inactive ItemID over -3 month. ItemID which havent move OUT in -3 month (ill make into field parameter 6/12/24/36 month).

IDItemIDStatusDate
8101OUT20/07/22
7102IN15/07/22
6106OUT15/07/22
5105OUTnull
4106IN05/05/22
3101OUT28/03/22
2103OUT24/02/22
1102IN15/02/22

ItemID#Days
102155
103146
105null

Something I try.....
inactive_device_6m =
VAR _CurrentDate = MAX('DateTable'[Date])
VAR _6MonthsAgo = EOMONTH(_CurrentDate, -6)
VAR _ActiveItem6Month =
???
VAR _InactiveItemOver6Month =
???
Return
?? #DaysITEMHaventOut

maybe #day(inactive_item)

#days =
VAR
NumberOfDays =
MAX('DateTable'[Date]) -
'table'[Date]
RETURN
IF(
ISBLANK('table'[date]);
BLANK();
NumberOfDays
)

Im new to Power bi and Thank You.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Twe-Maker , Create measures like

 

Rolling 3 = CALCULATE(countrows(filter(Table, Table[Status]="OUT")), DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

Not out = countx(values(table[item ID]), if (Isblank([Rolling 3]), [item id], blank()  ) )

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Twe-Maker , Create measures like

 

Rolling 3 = CALCULATE(countrows(filter(Table, Table[Status]="OUT")), DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

Not out = countx(values(table[item ID]), if (Isblank([Rolling 3]), [item id], blank()  ) )

 

Thank you

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.