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

Tickets that Are Open in the End of The Monrh

I have a table A that has a column (opened_date) that is bound to a calendar table

table A also has a column (closed_date)

 

Data:
ID Date Opened                   Date Closed
1         Jul-17
2         Jul-17                         Aug-17
3        Aug-17                        Aug-17
4         Sep-17
5          Oct-17                        Oct-17

 

 

Then I have a Matrix that provides results by dates (calendar table)

 

What I wanted to know was how many tickets are open at the end of each month.

 

For example, at the end of July 2017 there were 2 open, at the end of August 2017 there were 0 open, but at the end of September 2017 there was 1 ticket open ....

 

So what I want to know is all the tickets that were open at the end of each month (the closed date has to be after the end of the month or else it's still empty)

 

so far I have this dax function in a measure:

# of Open  Prob =
VAR tmpTickets = ADDCOLUMNS('PROD',"Effective Date",IF(ISBLANK(PROB_PROD[CLOSED_AT]),TODAY(),PROB_PROD[CLOSED_AT]))
VAR minDate = FIRSTDATE(PROB_PROD[CLOASED_DATE])
VAR maxDate = LASTDATE(PROB_PROD[OPENED_DATE])

VAR tmpTable =
FILTER(
tmpTickets,
[OPENED_DATE] <= maxDate &&
[Effective Date] >= minDate &&
[CLOASED_DATE] = BLANK()
)

RETURN
COUNTROWS(tmpTable) + 0

 

But the only thing that the measure returns to me is to say all those who do not have closed date at the end of each month, not counting those that were closed after the month we are viewing in the Matrix

 

 

Could someone help me? I'm really grateful, because I've been around this problem for some time.

 

Best Regards, 

J.O.

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Where's the [CLOSED_AT] column in your original data? Could you please share the full sample data for further analysis?

 

Community Support Team _ Jimmy Tao

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

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.