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
nicole_91
Frequent Visitor

Issue finding amount of days it will take for the quantity to reach at least 95% of total

This is in the context of a KPI, so 95% means that I need to at least get 95% of my boxes to my customer in 8 days. If I don't, I want to see how many more days it would take to reach that KPI.

 

There are two parts to this issue:

 

1) I am trying to create a measure that indicates how many days from the Days column (calculated column) it will take to reach 95% of Quantity of Boxes delivered. I am having issues with even making a measure with a running total or running percentage because I don't use actual dates. 

 

2) I need to take that amount of days and see how many days over it is from my deadline of 8 days. (I am pretty sure how to do this, but thought that I would ask anyway.)

 

The sample is in this sample table, but obviously this is based in PBI, and the Days column is a calculated column that calculates time it took for a certain quantity of boxes to come in. The days it takes and the quantity of boxes on any given day always changes. The deadline does not.

 

DaysQuantity of Boxes
12
33
42
51
71
104
113
121
141

 

 

3 REPLIES 3
nicole_91
Frequent Visitor

@Greg_Deckler Would this be an instance for a loop? I just read a previous article you published regarding this topic and thought it might be applicable! Still looking for an answer!

I had to alter the formula, but with the RANKX, it will not break the ties...

 

TP =
    VAR TargetQuantityBoxes = SUM(BoxDelivery[Quantity of Boxes])*0.95
    RETURN
    CALCULATE([Sum of Quantity of Boxes],
        FILTER( VALUES(BoxDelivery[Days]),
            RANKX( VALUES(BoxDelivery[Days]), [Sum of Quantity of Boxes] && [New Index], , DESC, Dense) <=  TargetQuantityBoxes))
 
[Sum of Quantity of Boxes] is a measure that is literally the same thing as the Quantity of Boxes column because the Quantity of Boxes column is also a calculated column that I sum. (I have to sum it.)
 
I even created an Index Column with a New Index measure where I summed the Index Column and added 1 for the [New Index] measure, but there still wasn't any differientation. 

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.

Top Solution Authors