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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Ryan_OC
Helper I
Helper I

Targets vs Actual by stage - No dates!

Hi Guys, 

I hope you are all well. 

See link: PBIX FILE

 

To summarize what I'm looking to do:

 I'm analysing how legal files pass through a legal process (190 steps). I have the actual days each file takes to go through the legal steps, and the expected days it should take. I want to create a forecast of total days required from the current legal step to completion.

The remaining forecast for me is a stepping stone to get to an "expected completion date" for the file. You will see that the FactExpectedFile has no date since it is just a target (Expected days per legal step). I would further like to add the remaining value to the Latest Activity Date, but will tackle this afterwards :).

 

I followed the SQLBI.com's excellent post "Showing forecast and actuals in  the same chart with Power BI" and I've built a similar code

 

Remaining Expected Steps =
VAR LastLegalStep =
    CALCULATE(
       MAX( FactFiles[LegalSubStepIndex] ),
           FILTER( DimCurrentStep, DimCurrentStep[Legal Step] = "Current"))
    // this get me the current legal step the file
VAR RemainingLegalSteps =
    CALCULATE(
       [Expected Days],
           KEEPFILTERS( FactFiles[LegalSubStepIndex] >= LastLegalStep )
)
RETURN
    RemainingLegalSteps

 

But its not working. I just get the expected days for all the steps. 

 

the first part of te code is correct and I get the right value, but not the second part...?

 

Can anyone help?

 

I hope this is enough information to go on?

Thank you in advance!

1 REPLY 1
Ryan_OC
Helper I
Helper I

@Greg_Deckler 

Any chance you can have a look at the above... Please ;D

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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