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
vaalyushin
Helper I
Helper I

Get only open tickets

Hi Guys ,

I need your help in something , 

This is my dataset : 

issue_numberstatus_change_datecurrent_statusstatuscreation_datecreation_date - CopyCriticalLabel
253012/7/2021 0:00ClosedOpen12/7/2021 0:0012/7/2021 23:22High
253012/7/2021 0:00OpenOpen12/7/2021 0:0012/7/2021 23:22High
253012/9/2021 0:00ClosedClosed12/7/2021 0:0012/7/2021 23:22High
253012/9/2021 0:00OpenClosed12/7/2021 0:0012/7/2021 23:22High
261012/22/2021 0:00ClosedClosed12/22/2021 0:0012/22/2021 12:08Low
261012/22/2021 0:00ClosedOpen12/22/2021 0:0012/22/2021 12:08Low
261012/22/2021 0:00ClosedResolved12/22/2021 0:0012/22/2021 12:08Low
261012/22/2021 0:00ClosedIn progress12/22/2021 0:0012/22/2021 12:08Low
261012/22/2021 0:00OpenClosed12/22/2021 0:0012/22/2021 12:08Low
261012/22/2021 0:00OpenOpen12/22/2021 0:0012/22/2021 12:08Low
261012/22/2021 0:00OpenResolved12/22/2021 0:0012/22/2021 12:08Low
261012/22/2021 0:00OpenIn progress12/22/2021 0:0012/22/2021 12:08Low
262012/23/2021 0:00ClosedClosed12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00ClosedOpen12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00ClosedResolved12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00ClosedIn progress12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00OpenClosed12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00OpenOpen12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00OpenResolved12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00OpenIn progress12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00ResolvedClosed12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00ResolvedOpen12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00ResolvedResolved12/23/2021 0:0012/23/2021 13:24Low
262012/23/2021 0:00ResolvedIn progress12/23/2021 0:0012/23/2021 13:24Low
264112/28/2021 0:00ClosedOpen12/28/2021 0:0012/28/2021 18:11Low
264112/28/2021 0:00OpenOpen12/28/2021 0:0012/28/2021 18:11Low
264112/28/2021 0:00WaitingOpen12/28/2021 0:0012/28/2021 18:11Low
26412/7/2022 0:00ClosedClosed12/28/2021 0:0012/28/2021 18:11Low
26412/7/2022 0:00OpenClosed12/28/2021 0:0012/28/2021 18:11Low
26412/7/2022 0:00WaitingClosed12/28/2021 0:0012/28/2021 18:11Low

 

 

I need get table with only open tickets. The main column with status is current_status. I tried this dax code:

 

 

Open issue = 
FILTER (
         'jira_vulnerability_issues',
          jira_vulnerability_issues[current_status] = "Open" && jira_vulnerability_issues[status_change_date] = [Max Change Date]
    )


Max Change Date = CALCULATE(MAX('jira_vulnerability_issues'[status_change_date]),ALLSELECTED('jira_vulnerability_issues'[status_change_date]))

 

 

 

but it doesn't work

1 ACCEPTED SOLUTION

Okay so what I understand is that you want all the open tickets on the max change date.
Is this the result you want?

Aditya_Meshram_0-1647866303998.png

You can use 

Open issue = 
var Max_Change_Date = CALCULATE(MAX('jira_vulnerability_issues'[status_change_date]),ALLSELECTED('jira_vulnerability_issues'[status_change_date]))
return
FILTER (
         'jira_vulnerability_issues',
          jira_vulnerability_issues[current_status] = "Open" && jira_vulnerability_issues[status_change_date] = Max_Change_Date
    )

 

View solution in original post

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

Hi @vaalyushin ,

 

Has methods provided above solved your problem? If so, please kindly Accept helpful replies as the solution. More people will benefit from it.

 

Below is my simple test:

New Table = 
var _maxDate=MAX('Table'[status_change_date])
return 
FILTER('Table',[current_status]="Open" && [status_change_date]=_maxDate)

Output:

Eyelyn9_0-1648114995976.png

 

 

Or if the max_date is a dynamic selection in slicer, please firstly create a date table:

Date Slicer = CALENDAR(MIN('Table'[status_change_date]), MAX('Table'[status_change_date])) 

Then create a flag measure, and apply it to visual-filter pane, set as "is 1":

Eyelyn9_2-1648115419507.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Aditya_Meshram
Solution Supplier
Solution Supplier

Hi @vaalyushin 
can you try

 

Open issue = 
FILTER (
         'jira_vulnerability_issues',
          jira_vulnerability_issues[status_change_date] = [Max Change Date],
          jira_vulnerability_issues[current_status] = "Open"
    )

 

Sorry, i forgot a part of dax measure. my measure is the same, but it doesn't work (i get all tickets with closed state too)

Okay so what I understand is that you want all the open tickets on the max change date.
Is this the result you want?

Aditya_Meshram_0-1647866303998.png

You can use 

Open issue = 
var Max_Change_Date = CALCULATE(MAX('jira_vulnerability_issues'[status_change_date]),ALLSELECTED('jira_vulnerability_issues'[status_change_date]))
return
FILTER (
         'jira_vulnerability_issues',
          jira_vulnerability_issues[current_status] = "Open" && jira_vulnerability_issues[status_change_date] = Max_Change_Date
    )

 

@vaalyushin Maybe:

Table =
  VAR __Table = SUMMARIZE('Table',[issue_number],"last_date",MAX('Table'[status_change_date]))
  VAR __Table1 = 
    ADDCOLUMNS(
      __Table,
      "current_status",
          VAR __issue = [issue_number]
          VAR __date = [last_date]
        RETURN
          MAXX(FILTER('Table',[issue_number] = __issue && [status_change_date] = __date),[current_status)
RETURN
  FILTER(__Table1,[current_status] = "Open")

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors