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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
uie79957
Regular Visitor

Calculate percentage of entries >x days

Hi there, 

 

I am struggling writing a DAX code for following calculation. I have the table below (simplified) and I want to calculate the share of customer complaints with a processing time >42 days. The column "processing time" is calculated from "date opened" and "date closed"

 

Customer Complaint Claim IDDate OpenedDate ClosedProcessing Time
123.08.202130.11.202199
229.09.202230.09.20221
307.06.202211.07.202234
4...------
5...------
6...------
7...------

 

Thanks for your support

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@uie79957 , if you do not have Processing Time

 

a new column

Processing Time= datediff([OpenDate], [Close Date], Day )+1

 

 

A new measure

 

divide(countrows(filter(table, Table[Processing Time] >42)), countrows(table))

 

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

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could create a measure like

Percent overdue =
VAR TotalComplaints =
    COUNTROWS ( 'Table' )
VAR ComplaintsOver42 =
    CALCULATE ( COUNTROWS ( 'Table' ), 'Table'[Processing time] > 42 )
RETURN
    DIVIDE ( ComplaintsOver42, TotalComplaints )
amitchandak
Super User
Super User

@uie79957 , if you do not have Processing Time

 

a new column

Processing Time= datediff([OpenDate], [Close Date], Day )+1

 

 

A new measure

 

divide(countrows(filter(table, Table[Processing Time] >42)), countrows(table))

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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