Forum Discussion

JLambs20's avatar
JLambs20
Icon for Helper III rankHelper III
4 years ago
Solved

Change Revenue Numbers based on a Percentage Selected from a Dropdown

Hello,

 

I would like to dynamically change a value based on a percentage that is selected from a dropdown list.  The scenario is that there is a maximum revenue generated per year but then the user has the option to select a percent from a dropdown and have the revenue numbers reflect that.  In other words, if the max revenue generated is $1,000,000 for each year, then a user could select "25%" and then the revenue changes to $250,000 for year 1.  I'm thinking I could pull this off with SELECTEDVALUE in a measure but I'm not entirely certain. I had used SUMX to get my revenue numbers per year in a table but I don't know how to incorporate the percentage aspect. Is this possible?

 

 


Thank you!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi JLambs20 ,

     

    According to your description and screenshot, it seems that the fields used for Year slicer and % slicer are from other tables, so I have create a data sample like:

     

    Original Table:

    Add two tables:

      

    Then please try:

    Measure = 
    var _selectYears= SUMX(FILTER('Table',[Year] in ALLSELECTED('Select Year'[Year Only])),[Revenue])
    var _selePer= SELECTEDVALUE('Select %'[Value])
    return _selectYears * _selePer

    Output:

     

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

3 Replies

  • Hi JLambs20 ,

    You can use a disconnected table that holds the percentages. This can be done by using the Enter Data function or through DAX. You can use GENERATESERIES function to create a table that holds the percentages - example:

    Percent Parameter = 
    VAR __BASE_TABLE =
        GENERATESERIES ( 0, 1.001, 0.01 )

     

    You can then create a measure to multiple a measure based on the value from another table.

    Pct Revenue =
    SELECTEDVALUE ( 'Percent Parameter'[Value] ) * [Revenue Measure]
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi JLambs20 ,

     

    According to your description and screenshot, it seems that the fields used for Year slicer and % slicer are from other tables, so I have create a data sample like:

     

    Original Table:

    Add two tables:

      

    Then please try:

    Measure = 
    var _selectYears= SUMX(FILTER('Table',[Year] in ALLSELECTED('Select Year'[Year Only])),[Revenue])
    var _selePer= SELECTEDVALUE('Select %'[Value])
    return _selectYears * _selePer

    Output:

     

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