cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
naveen73
Helper I
Helper I

Goal Seek

Hi All,

 

I have a question about Goal Seek possibility in Power Query. I have a fictive loan dataset.

Start Collateral

The value of the collateral at the beginning of the loan

Collateral

Currently value of the collateral

Loans

Outstanding loan balance

Current Value – Loans

The difference between the current value of the collateral and the outstanding loan balance

 

I want to know what the % (cell G2) the collateral should decrease so that sum of the difference The difference between the current value of the collateral and the outstanding loan balance will be zero, cell G8. I am using the Excel Goal Seek function to calculate cell G2.

I want to know if there is a similar way to perform a Goal Seek using Power Query, either in Excel or Power BI, but preferably both.

Cells C3 – E7: hard values

Cell F2: Formula =D3-E3, copied down to F7

Cell G3: Formula =(D3*$G$2)-E3 copied down to G7

Cell G2: hard value, to be calculated

Cell G8: =SUM(G3:G7)

 

naveen73_0-1656149498249.png

 

I looked around and this is what I found:

 

https://community.powerbi.com/t5/Desktop/HELP-WITH-DAX-Simulate-Excel-What-If-Analysis-Goal-Seek/m-p...

 

But it is not clear to me.

 

Thanks,

 

Nav

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @naveen73 ,

 

Please try these measures.

 

Current Value - Loans = 
SUM ( 'Table'[Collateral] ) - SUM ( 'Table'[Loans] )
G = 
VAR G2 = 0.8557287
RETURN
    SUM ( 'Table'[Collateral] ) * G2
        - SUM ( 'Table'[Loans] )

vkkfmsft_0-1656382706529.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @naveen73 ,

 

Please try these measures.

 

Current Value - Loans = 
SUM ( 'Table'[Collateral] ) - SUM ( 'Table'[Loans] )
G = 
VAR G2 = 0.8557287
RETURN
    SUM ( 'Table'[Collateral] ) * G2
        - SUM ( 'Table'[Loans] )

vkkfmsft_0-1656382706529.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi Naveen


I appreciate that this post is already marked as solved but not sure that the solution provided actually mimics the goal seek feature of Excel - if the logic is simple you can reverse it to find the unknown variable (as has been proposed) but in a case like this where you need to iterate through the result of multiple calculations I don't believe this approach works!

 

I've instead proposed an approach using the list.accumulate function in M (excel version https://rsaprahotmail.sharepoint.com/:x:/s/LDIGeneral/EVAB-rjIjAZNjTsKCGO-yT0BmhY7MxFaphB5h-OQBkCAxg... and PBI version https://rsaprahotmail.sharepoint.com/:u:/s/LDIGeneral/EY2hW3C2_INLk0qLjp_jiFsBAxHHITZNixPn3AgI2yDBOw...) - let me know what you think pls!

 

 

 

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Top Kudoed Authors