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
naveen73
Helper III
Helper III

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
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
Top Kudoed Authors