Forum Discussion

2_Flash's avatar
2_Flash
Regular Visitor
1 year ago
Solved

NPV with dynamic value selection

Hi,

 

I'm trying to develop an investment review model where users can easily select initial investment values, tax rates, and other parameters to dynamically calculate the NPV. I've created a basic table for cash flows, and the calculations work fine. However, the challenge is that the values—such as investment amounts and tax rates—must be entered manually. Ideally, I'd prefer to use parameters, but they're not working with the table format.

 

Hopefully someone can assist with a simple solution.

 

Below is my table that calculates NPV: The Net Income value is calculated in the table 

 

 

 

Net income =
var genvalue=[Generation value]
var incomerate=[Income rate]
var taxrate=[Tax rate]
var degrate=[Degration rate]
var income=genvalue*incomerate-100*degrate*(Cashflow[ID]-1)
var expense=income*taxrate
return if(Cashflow[ID]=0,[Initial Investment],income-expense)
 
DAX that needs to be selected dynamically:
Initial Investment = -3000
Tax rate = 0.19
 
Link to the PBIX model
  • but I need to go into Powerquery each time I need to change a value.

    No, you can do that directly in Power BI, via "Edit Parameters"

     

     

4 Replies

  • the challenge is that the values—such as investment amounts and tax rates—must be entered manually. 

    Power BI does not support manual entry by default (some third party visuals do).  The standard functionality is limited to "What-if?" parameters with a range of max 1000 discrete values

     

    I'd prefer to use parameters, but they're not working with the table format.

    They will if you let them.  Change the Power Query Parameter to "Enable Load"  and it changes from an expression to a partition and will be accessible in Power BI.  You can also modify Power Query parameter values from the Power BI menu, but then you will need to manually initiate a refresh for the change to take hold.  Not something your report users can do.

  • 2_Flash's avatar
    2_Flash
    Regular Visitor

    Thanks for your repsonse:

    1) Re: Power BI does not support manual entry by default (some third party visuals do). - Prefer to stick to standard PowerBI

    2) Re:Change the Power Query Parameter to "Enable Load"  and it changes from an expression to a partition and will be accessible in Power BI. - Yep, did that, but I need to go into Powerquery each time I need to change a value.  Probably not feasible for a group of users.

    • lbendlin's avatar
      lbendlin
      Super User
      but I need to go into Powerquery each time I need to change a value.

      No, you can do that directly in Power BI, via "Edit Parameters"

       

       

      • 2_Flash's avatar
        2_Flash
        Regular Visitor

        Gotcha! Ok, I'll play around with this concept. Thank you