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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lynnzrae
Helper I
Helper I

How to only calculate a date once for a project when there are multiple project entries

I have this set of data.  I want to calculate the number of days between application being deemed complete and the decision being rendered so that I can look at the average number of days for cycle time.  However, I only want to calculate this once per project (Permit UID).  Right now the project (Permit UID) can have multiple line items if there are other activities within the project that have more than one entry.  In this example, for two of the projects the application was submitted twice so there are two line items for the same project.  How do I only calculate the application deemed complete once?  So instead of the average of 1/24/2025, 1/24/2025, 9/20/2024, 9/20/2024, 10/17/2024 (=30.6 days) I am calculating 1/24/2025, 1/24/2025, 9/20/2024, 9/20/2024, 10/17/2024 (=29 days).  Thank you.

 

Permit UIDApplication ReceivedApplication Deemed CompleteDecision Rendered
961510/15/20241/24/20252/19/2025
961512/12/20241/24/20252/19/2025
94352/14/20249/20/202410/30/2024
94354/26/20249/20/202410/30/2024
95679/26/202410/17/202411/7/2024
1 ACCEPTED SOLUTION

@lynnzrae,

 

Try this calculated column. The logic is to calculate the number of days for the row with the earliest Application Received date (when multiple rows exist for a Permit UID).

 

Number of Days for Cycle Time =
VAR vMinDate =
    CALCULATE (
        MIN ( Projects[Application Received] ),
        ALLEXCEPT ( Projects, Projects[Permit UID] )
    )
VAR vResult =
    IF (
        Projects[Application Received] = vMinDate,
        DATEDIFF (
            Projects[Application Deemed Complete],
            Projects[Decision Rendered],
            DAY
        )
    )
RETURN
    vResult

 

DataInsights_0-1744835244683.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
lynnzrae
Helper I
Helper I

That did it.  Thank you.

DataInsights
Super User
Super User

@lynnzrae,

 

Try this measure:

 

Average number of days for cycle time = 
AVERAGEX (
    SUMMARIZE (
        Projects,
        Projects[Permit UID],
        Projects[Decision Rendered],
        Projects[Application Deemed Complete]
    ),
    DATEDIFF (
        Projects[Application Deemed Complete],
        Projects[Decision Rendered],
        DAY
    )
)

DataInsights_0-1744830387107.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Can I do this without using the average Dax so that I can use this for other visuals etc. as well.  Can I just do it where it returns the number of days and then when I create the call card I can do the average?  Not sure if that makes sense.  Something like this? so that it only returns a value on one of any project that has duplicate rows?  Thank you.

 

Permit UIDApplication ReceivedApplication Deemed CompleteDecision Rendered# of days from deemed complete to decision rendered
961510/15/20241/24/20252/19/202526
961512/12/20241/24/20252/19/2025 
94352/14/20249/20/202410/30/202440
94354/26/20249/20/202410/30/2024 
95679/26/202410/17/202411/7/202421

@lynnzrae,

 

Try this calculated column. The logic is to calculate the number of days for the row with the earliest Application Received date (when multiple rows exist for a Permit UID).

 

Number of Days for Cycle Time =
VAR vMinDate =
    CALCULATE (
        MIN ( Projects[Application Received] ),
        ALLEXCEPT ( Projects, Projects[Permit UID] )
    )
VAR vResult =
    IF (
        Projects[Application Received] = vMinDate,
        DATEDIFF (
            Projects[Application Deemed Complete],
            Projects[Decision Rendered],
            DAY
        )
    )
RETURN
    vResult

 

DataInsights_0-1744835244683.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.