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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Gav10
Helper II
Helper II

Calculate future values based on already calculated value

Hi 

 

Hoping soomeone can help because this is beating me!

 

I'm trying to create a calculated column which gives future fill figures (see below) based on actual inflow and outflow values and the latest fill value. 

The problem i'm having trouble with is trying to reference the predicted value in the 'Future Fill' column when the 'Actual Fill' is blank

 

Untitled.png

I currently have;

Future Fill = CALCULATE(sum(Mytable[Actual Fill]), PARALLELPERIOD(Mytable[Date], -1, month)) - Mytable[Future outflow] + Mytable[Future inflow]

 

This of course is only fine when there is an 'Actual Fill' value, when the value is blank it returns 1, -2 and 4 for the future months as opposed to the desired result above.

 

When 'Actual Fill' is blank i need the formula to use the previous 'Future Fill' value

 

Does anyone have any ideas?

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Gav10 Smells an awful lot like recursion aka previous value which is a no-no in DAX. Previous Value (“Recursion”) in DAX - Microsoft Fabric Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Gav10 Smells an awful lot like recursion aka previous value which is a no-no in DAX. Previous Value (“Recursion”) in DAX - Microsoft Fabric Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  i had a feeling it wouldn't be pretty! I've been trying all sorts so gives me some comfort that it wasn't me going mad!

 

@Gav10 Nope, not going mad. I have tried for years and years to beat this problem and to no avail. It's like the one unsolvable problem left for me in DAX.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.