Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am looking for DAX that will count the number of Opened tasks during the last 30 days and 90 days.
I have this simple table below
Task | Created |
Opened | 01-Dec |
Closed | 02-Dec |
Closed | 02-Dec |
Closed | 04-Dec |
Opened | 05-Dec |
Opened | 06-Dec |
Opened | 07-Dec |
I will use Card to display this count
Solved! Go to Solution.
Try this:
Last 30 days = CALCULATE ( COUNT( Table[Task_ID] ), FILTER ( ALL ( Table ), Table[date] >= MAX ( Table[date] ) - 30 && Table[date] <= MAX ( Table[date] ) && Table[Task] = BLANK() ) )
OR
Last 30 days = CALCULATE ( COUNT( Table[Task_ID] ), FILTER ( ALL ( Table ), Table[date] >= MAX ( Table[date] ) - 30 && Table[date] <= MAX ( Table[date] ) && LEN[Task] = 0 ) )
try this formula
Last 30 days = CALCULATE ( COUNT( Table[Task_ID] ), FILTER ( ALL ( Table ), Table[date] >= MAX ( Table[date] ) - 30 && Table[date] <= MAX ( Table[date] ) && Table[Task] = "Opened" ) )
@themistoklis, thank for quick response. What is the Table[value] you are using from? i dont have any such column
I have amened the previous formula,
I have put task_Id instead of value and count instead os SUM.
In other words this is the place where you count the number of tasks.
I dont know which field identifies the tasks so i have just put Task_ID (which you can replace with the relevant field)
Thanks @themistoklis, it is working now. Can you also amend for values returning Blank?
Try this:
Last 30 days = CALCULATE ( COUNT( Table[Task_ID] ), FILTER ( ALL ( Table ), Table[date] >= MAX ( Table[date] ) - 30 && Table[date] <= MAX ( Table[date] ) && Table[Task] = BLANK() ) )
OR
Last 30 days = CALCULATE ( COUNT( Table[Task_ID] ), FILTER ( ALL ( Table ), Table[date] >= MAX ( Table[date] ) - 30 && Table[date] <= MAX ( Table[date] ) && LEN[Task] = 0 ) )
User | Count |
---|---|
103 | |
91 | |
79 | |
72 | |
68 |
User | Count |
---|---|
108 | |
96 | |
95 | |
74 | |
71 |