Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Help With Formula

Hi,

 

I am currently working on a project and could use some help with a function. So i have an SQl server connection with data, and I am trying to take one of the columns and multiply the values by a selected increase or decrease, and then take that increase or decrease value and multiply that new amount by an entered value for a price for a certain month and criteria. Bascially I want something along the lines of ((original Value)*(% increase/decrease)) * (one of 40 entered values based on what month it is and what of the four criteria I have).

 

Is this even possible?

 

Thanks.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    Here’s how you can do it:

    1. Load Your Data

    2. Define Parameters
    If you want to set parameters like increase/decrease percentage, month, and criteria, you can use Power BI parameters

     

    3. Create Calculated Columns or Measures
    Assume you have a separate table called 'PriceTable' with columns 'Month', 'Criteria', and 'Price'.
    To find the price based on month and criteria, and then calculate the final value:

    (1) Create a Relationship between your main table and 'PriceTable' based on 'Month' and 'Criteria' (if applicable).

    (2) Create a Measure for Final Value:

     

    FinalValue =
    VAR Adjusted = [OriginalValue] * (1 + [IncreasePercentage])
    VAR Price =
    CALCULATE(
    MAX(PriceTable[Price]),
    FILTER(
    PriceTable,
    PriceTable[Month] = [Month] &&
    PriceTable[Criteria] = [Criteria]
    )
    )
    RETURN
    Adjusted * Price



     

     

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      I appreciate your response, but I am incredibly confused on what you are trying to tell me to do. 

       

      Could you explain better?

       

      Thanks,

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      This reply is awesome but at least now it seems like I would have to do a million different measures to acheive what I am trying to.