Forum Discussion

showy's avatar
showy
Helper II
2 years ago
Solved

Control serveral Measures with Fieldparameters

Hello I have the following problem. In my PBI report I have 3 different revenues, the constant quantity and I want to calculate the average price per month. The whole thing has to be controlled with...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi showy ,

     

    Please try:

     

    Create field parameters:

     

    Create a measure in 'Table' table:

    AVG Price = SWITCH(
        TRUE(),
        SELECTEDVALUE(Parameter[Parameter Fields]) = "'Table'[Revenue1]",DIVIDE(MAX('Table'[Revenue1]), MAX('Table'[Quantity])),
        SELECTEDVALUE(Parameter[Parameter Fields]) = "'Table'[Revenue2]",DIVIDE(MAX('Table'[Revenue2]), MAX('Table'[Quantity])),
        SELECTEDVALUE(Parameter[Parameter Fields]) = "'Table'[Revenue3]",DIVIDE(MAX('Table'[Revenue3]), MAX('Table'[Quantity]),
        BLANK()
    ))

     

    'Table'[Revenue1] is placed in Switch because SELECTEDVALUE(Parameter[Parameter Fields]) returns this:

     

    Drag the fields as shown below into the table visual:

     

    The final page effect is as shown below:

     

    pbix file is attached.

     

    If you have any further questions please feel free to contact me.

     

    Best Regards,
    Yang
    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!