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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rocky09
Solution Sage
Solution Sage

Issue with Summarizing Status Count

See below table, I have cat. column, where Users start working on each cat. and change the status to Inprogress, Complete and some times rework.

 

So, if a Cat. worked on 5 days and status will be In progress for 5 days, on 6th day , the work was completed. So, the status will becomes Completed.  Now, I am trying to count of Status.

 

Logic is:

 

* If any of the Cat. has Completed. The Cat. will show under Completed and it should counts only one.

* If any of the Cat. is still In Progress, the Cat. will show InProgress status and it should take count as one every it has 10 Previous inprogress days.

*Same logic appicable to rework.

 

See my sample data and the solution i am expecting.

 

DateCat.Status
2-Oct-17alpha_9383993In Progress
3-Oct-17Pulse_9387388In Progress
4-Oct-17Pulse_9387388Rework
5-Oct-17alpha_9383993In Progress
6-Oct-17alpha_9383993Completed
7-Oct-17Pulse_9387388Completed
8-Oct-17Oppo_tes_9383In Progress
9-Oct-17Oppo_Max_8977Rework

 

StatusCount
Completed2
In Progress1
Rework1
1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @rocky09,

 

Based on my test, the formula below should work in your scenario.

Count = 
VAR maxDate =
    CALCULATE (
        MAX ( Data[Date] ),
        FILTER ( ALL ( Data ), Data[Cat.] = EARLIER ( Data[Cat.] ) )
    )
VAR minDate =
    CALCULATE (
        MAX ( Data[Date] ),
        FILTER ( ALL ( Data ), Data[Cat.] = EARLIER ( Data[Cat.] ) )
    )
RETURN
    IF (
        Data[Status] = "Completed",
        1,
        IF ( Data[Date] = maxDate, 1 + DATEDIFF ( minDate, maxDate, DAY ) / 10, 0 )
    )

c1.PNGr1.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

15 REPLIES 15

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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