March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a table in Power BI with the following 3 columns:
Incident Number, Date Opened, Date Closed
It has about 1,000 rows, covering 3 years.
I want to create a graph showing how many incidents were open on each of the dates in the table. To that end, I have created a date table with all dates covered by the Incident table:
Dates = CALENDAR(MIN('Incidents'[Date Opened]), MAX('Incidents'[Date Opened]))
For every date, I want to create a count of how many incidents were open (so either a close date after that date or no close date (incident is still open).
So what I need is to do is something like :
Dates[Open Count] = COUNTROWS(FILTER('Incidents', ('Incidents'[Date Opened] < 'Dates[Date]) AND ('Incidents[Date Closed] > 'Dates[Date] OR 'Incidents[Date Closed] = BLANK() ))
add the table name, slap a MAX() around it or use variables. The exact syntax depends on your scenario.
Thanks for that.
I've not managed to try it yet as I'm getting the error:
It's also showing that the [Date] field isn't found, which I worked out is due to this error:
Did that expression work for you?
Nearly there.
[Open Count] = CALCULATE(COUNTROWS('Incidents'),'Incidents'[Date Opened] < [Date]),COALESCE('Incidents[Date Closed],[Date]) > [Date])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |