cancel
Showing results for
Did you mean:
Highlighted
Helper I

## Measure for Count of opened items during last 30 days

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member

## Re: Measure for Count of opened items during last 30 days

@ymirza

Try this:

```Last 30 days =
CALCULATE (
FILTER (
ALL ( Table ),
Table[date]
>= MAX ( Table[date] ) - 30
&& Table[date] <= MAX ( Table[date] )
)
)```

OR

```Last 30 days =
CALCULATE (
FILTER (
ALL ( Table ),
Table[date]
>= MAX ( Table[date] ) - 30
&& Table[date] <= MAX ( Table[date] )
)
)```
5 REPLIES 5
Highlighted
Memorable Member

## Re: Measure for Count of opened items during last 30 days

@ymirza

try this formula

```Last 30 days =
CALCULATE (
FILTER (
ALL ( Table ),
Table[date]
>= MAX ( Table[date] ) - 30
&& Table[date] <= MAX ( Table[date] )
)
)```

Highlighted
Helper I

## Re: Measure for Count of opened items during last 30 days

@themistoklis, thank for quick response. What is the Table[value] you are using from? i dont have any such column

Highlighted
Memorable Member

## Re: Measure for Count of opened items during last 30 days

@ymirza

I have amened the previous formula,

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)

Highlighted
Helper I

## Re: Measure for Count of opened items during last 30 days

Thanks @themistoklis, it is working now. Can you also amend for values returning Blank?

Highlighted
Memorable Member

## Re: Measure for Count of opened items during last 30 days

@ymirza

Try this:

```Last 30 days =
CALCULATE (
FILTER (
ALL ( Table ),
Table[date]
>= MAX ( Table[date] ) - 30
&& Table[date] <= MAX ( Table[date] )
)
)```

OR

```Last 30 days =
CALCULATE (
FILTER (
ALL ( Table ),
Table[date]
>= MAX ( Table[date] ) - 30
&& Table[date] <= MAX ( Table[date] )
)
)```

Announcements

#### Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

#### Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

#### Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021