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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.