Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Cumulative Pending Cases

Hi everyone, 

I've been trying to write a measue for cumulative pending cases where it should interact with date filter accordingly as point in time.

 

I have data where i have a startdate, enddate for each status of case and case submitted date.

Case submitted date is active relation with a date colum in claender table and  an inactive relation between status start date and date.

In my scenario, there are few different case status (P,SI,FP) which all together known as Pending.

 

2.PNG

Data looks as above.

 

I am using the following DAX, but its not generating the required results.

Cumulative Measure = CALCULATE ( DISTINCTCOUNT( Data[GUID] ), FILTER('Data', AND('Data'[ENDDATE]<= MAX('Date'[Date]), Data[STARTDATE]>= MIN('Date'[Date])) ))
 
Expected result is as follows where there are total 4 pending cases as of today in October, 7 pending cases at the end of Sep , 3 pending cases at the end of Aug and so on.
If we selected the date filter from 04/01/2018 to 07/10/2018. On 7th month (July) it should show the number of applications that are pending on 07/10/2018. 

3.png

Thanks in advance.

2 REPLIES 2
Anonymous
Not applicable

You can try, this should count the project that where pending during the month:

VAR miDate = MIN('Date'[Date]) // Start of the month in your graph 
VAR mxDate = MAX('Date'[Date])  // End of the month in your graph


RETURN
CALCULATE ( 
    DISTINCTCOUNT( Data[GUID] ), 
    FILTER(
       ALL('Data'), 
       // Projects that stared within the month
       (miDate <= 'Data'[STARTDATE] &&  'Data'[STARTDATE] <= mxDate)
       ||
       // Projects that ended within the month
        (miDate <= 'Data'[ENDDATE] &&  'Data'[ENDDATE] <= mxDate)
       ||
       // Projects that are pending the whole month
        ('Data'[STARTDATE] <= miDate  &&  mxDate <= 'Data'[ENDDATE])
       ||
       // Projects that are pending the during month
        (miDate <= 'Data'[STARTDATE]  &&  'Data'[ENDDATE] <= mxDate)
    ),
    'Data'[STATUS] IN {"P","V","F"},     // Filters on pending
    ALL('Date')  // Removes the date filter (not sure if you need to this)
)


And if you would like to get those that are pending on the end of the month:

 

VAR mxDate = MAX('Date'[Date])  // End of the month in your graph


RETURN
CALCULATE ( 
    DISTINCTCOUNT( Data[GUID] ), 
    FILTER(
       ALL('Data'), 
        ('Data'[STARTDATE] <= mxDate  && mxDate <= 'Data'[ENDDATE] ) 
    ),
    'Data'[STATUS] IN {"P","V","F"},     // Filters on pending
    ALL('Date')  // Removes the date filter (not sure if you need to this)
)

If it does not work I hope that it directs you to the right direction 🙂

Regards,

Kristjan

 

 

Anonymous
Not applicable

Hi Kristjan,

 

Thanks for your reply.

I am using end of month dax but i am getting some redendancy for latest month

The dax is not working with some other filters that I need to represent on dashboard.

I tried few scenarios but no luck.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.