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
Anonymous
Not applicable

DAX : count of total tickets which are either created or resolved with in the selected date range

Dear Community,

 

(Attaching the sample data and the PBIX )

 

What i need is all the tickets which are either created between selected dates or resolved between selected dates.  Date would be a role playing dimension.

 

3 Measures

 

Total Tickets created or resolved - Count of tickets which are either created or resolved between the selected dates

 

i.e if a ticket xxx is created before jan 1st but resolved after jan 1st that should be part of Total Tickets created or resolved

 

Total Tickets created - Count of tickets which are either created in the selected time frame or created and resolved in the selected time frame

 

Total Tickets created - Count of tickets which are either created and resolved in the selected time frame or only resolved in the selected time frame...

 

Thanks,

Nishanth.

 

8 REPLIES 8
Anonymous
Not applicable

to be more specific - what i need is to convert below query to DAX

 

select [id],Created,ResolutionDate from data where
project = 'CSR'
and ( Created between '2021-03-07' and '2021-03-13' or ResolutionDate between '2021-03-07' and '2021-03-13' )
order by Created

Hi @Anonymous ,

 

select [id],Created,ResolutionDate from data where
project = 'CSR'
and ( Created between '2021-03-07' and '2021-03-13' or ResolutionDate between '2021-03-07' and '2021-03-13' )
order by Created

 

Try to create such a calculated table.

Table = 
SUMMARIZE(
    FILTER(
        data,
        ( ([CreatedDate] >= DATE(2021,3,7) && [CreatedDate] <= DATE(2021,3,13)) || ([ResolvedDate] >= DATE(2021,3,7) && [ResolvedDate] <= DATE(2021,3,13)) ) && [project] = "CSR"
    ),
    [Ticket ID], [CreatedDate], [ResolvedDate]
)

 

Best regards,
Lionel Chen

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

Anonymous
Not applicable

yes i did this, what in need is how to make the dates given there dynamic...

Hi @Anonymous ,

 

It is not possible to create a dynamic calculation table, so you still need to consider creating measures and adding them to a table visual.

 

The reason why I removed the table relationship when I first responded to you is because I think the relationship between your two tables is meaningless and will cause statistical results to be wrong. Or is my understanding wrong?

 

Are the results returned by the following three measures correct?

v-lionel-msft_2-1618303514131.png

 

Best regards,
Lionel Chen

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

 

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1617675463439.png

 

Best regards,
Lionel Chen

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

Anonymous
Not applicable

Hi v-lionel,

 

Thanks for your reply. I see you have removed the relationship between DimDate and Data tables, but i need that relationship to be available and achieve the same.

 

Thanks,

Nishanth.

selimovd
Super User
Super User

Hey @Anonymous ,

 

where exactly are you struggling?

 

Best regards

Denis

Anonymous
Not applicable

Hi Denis,

 

I get this data from Jira, where i can write a query which pulls all the records which are either created or resolved with in dates.

 

But in Power BI, i am not able to exactly get that functionality.

 

I need an active relationship between DimDate and Ticket Data on Created Date and an inactive relationship between DimDate and resolved date.

 

When i select a date range, i can get the created tickets in the date range, but what i also need is there can be tickets created before that date range which are resolved in those days.

 

Thanks,

Nishanth.

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.