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.
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 ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |