Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
Been lurking around the forum looking for an answer but I cannot figure it out.
I need to calculate # of open cases - a backlog of cases that is carried over from previous day.
I have my main query 'Query 1' and a calendar table - 'Time Period Daily'
Here is what I have so far:
Cases Opened:
Cases Closed:
Cases Still Open:
Here is my result, however, it seems to calcute August wrong - if one of the cases was closed on August 22nd then it should be 3 not 4 cases.
When I drill down to date level, data shows accurately.
And, how do I ensure that "Cases Still Open" measure shows only up to current date not my entire 'Time Period Daily' table?
Solved! Go to Solution.
Hi @StoryofData ,
I update your measure and get the correct result.
Cases Still Open =
CALCULATE (
DISTINCTCOUNT ( 'Query1'[CaseNumber] ),
FILTER (
'Query1',
(
'Query1'[DateOpened] <= MAX ( 'Time Period Daily'[Full Date] )
&& 'Query1'[DateClosed] > CALCULATE ( MAX ( 'Time Period Daily'[Full Date] ) )
|| 'Query1'[DateOpened] <= CALCULATE ( MAX ( 'Time Period Daily'[Full Date] ) )
&& ISBLANK ( 'Query1'[DateClosed] )
)
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @StoryofData ,
I update your measure and get the correct result.
Cases Still Open =
CALCULATE (
DISTINCTCOUNT ( 'Query1'[CaseNumber] ),
FILTER (
'Query1',
(
'Query1'[DateOpened] <= MAX ( 'Time Period Daily'[Full Date] )
&& 'Query1'[DateClosed] > CALCULATE ( MAX ( 'Time Period Daily'[Full Date] ) )
|| 'Query1'[DateOpened] <= CALCULATE ( MAX ( 'Time Period Daily'[Full Date] ) )
&& ISBLANK ( 'Query1'[DateClosed] )
)
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@StoryofData , refer this approch
Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU
and file attached
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 31 | |
| 30 | |
| 23 |