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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

How to calculate Complaint Status (New, Closed and WIP) for each month?

Hi Everyone,

 

I am new to Power BI and in need of calculating Status for each complaint Nbr.

Criteria:

New - Created in the current month (can have both open/Closed complaints)

WIP - Open Complaints created prior to current month (closed month is null)

Closed - Closed Complaints in that month (but not created in that month as it will come under New status)

Everything is based on the 1st day of new month.

 

For example

I need to calculate "Status" field for each month as below using DAX function.

 

Sample dataset for Jan 2019:

 

Complaint Nbr  CreatedMonth  ClosedMonth   Status

C1                         Jan 2019         Jan 2019         New

C2                         Dec 2018                               WIP

C3                         Jan 2019                                New

C4                         Dec 2018        Jan 2019         Closed

 

Thanks in Advance!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , refer if this blog can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak : Hi,

 

I am facing difficulty in finding a solution for Closed status. I tried using the below formula for the same. But it is not giving correct result as expected.

 

For Closed : Closed in the respective months but those complaints should not be created in the same month.

 

Closed = calculate(DISTINCTCOUNT(Data[Complaint Nbr]),filter(Data,Month(Data[Creation Date])<> month(Data[Closure Date])) ,not(ISBLANK(Data[Closure Date])))

 

Kindy help me on the same.

Anonymous
Not applicable

@v-lid-msft : Refered your post and modified according to my case and it worked perfectly.

 

https://community.powerbi.com/t5/Desktop/Carrying-Over-Open-Case-Amount-from-Previous-Month/m-p/1081...

 

Thanks!

Anonymous
Not applicable

@amitchandak : Thanks for your reply.

 

I am following your post to implement certain logic in my dataset. However, is there anyway to count distinct value of Compliant Nbr? In my dataset, i have duplicate complaint Nbr based on other dimension.

 

For Current Employee(in your dataset), it is similar to my New Status except that it is fetching all rows because of Countx function.

But i need to derive distinct count of complaint Nbr.

 

Please let me know if this is possible. Thank you in advance!!

Anonymous
Not applicable

@amitchandak : Sorry, i just figured how to find distinct count in filtered table and it works now.

 

Thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.