Forum Discussion
sagarsahoo_123
1 year agoHelper IV
How to get 3months consecutive Low Worktime Users!
Hi Team, Hope all are doing good. Need your help to resolve a query. I have a table having Month, Personal_ID, worktime columns. Based on month selection i want to bring last 3 months userid who hav...
rohit1991
1 year agoSuper User
Hi sagarsahoo_123 ,
You need to exclude users with blanks and ensure that only those with worktime < 6 hours for all three months are displayed. Modify your DAX measure as follows:
Step 1: Adjust the Last 3 Months Worktime Calculation
Last_3M_WT =
VAR max_date = MAX(FY_Calendar[Date])
VAR PreviousDates = DATESINPERIOD(FY_Calendar[Date], max_date, -3, MONTH)
VAR Result =
CALCULATE(
[Avg WT],
FILTER(
VALUES(VW_ARC_SKILL[Personal_ID]),
COUNTROWS(
FILTER(
VW_ARC_SKILL,
VW_ARC_SKILL[WorkTime] < 6 &&
VW_ARC_SKILL[Date] IN PreviousDates
)
) = 3 -- Ensures all 3 months have values
)
)
RETURN Result
Step 2: Ensure Avg WT is Defined Properly
Avg WT = AVERAGE(VW_ARC_SKILL[WorkTime])
- This measure ensures that only users who have values for all 3 months with worktime <6 hours appear in the matrix.
- The COUNTROWS = 3 condition ensures only users with no blanks in the selected period are shown.
sagarsahoo_123
1 year agoHelper IV
Hi rohit1991 ,
Thanks for your support, but i am not getting the desired result. Please find the below screenshot after applying code suggested by you.
But i am expecting to show last 3months along with Worktime value in all month like below 1st row.
Please guide if anytthing else needs to be done!
Regards,
Sagar