Forum Discussion

swinings's avatar
swinings
Helper I
5 years ago
Solved

PBI Filter times What If Parameter - Possible?

The what-if function is amazing and I wish I knew about it sooner.

Now, however, I am looking to multiply my filtered value by the what-if parameter. I know I will need a new measure, but I'm unsure the DAX formula.

I.e. 

 

Total Amount/New Measure = (chosen rate/filter) * ((Number of Days/Weeks/Months * Number of Units Per Day/Week/Month) * Number of People Receiving Service)

 

I'm looking for the first part of the DAX code (the chosen rate/filtered info).

 

Is this even possible? Or do I have to separate all my rates into individual measures? I was hoping I could do this filtering so that people can choose the rate.

 

This is then going to be added to average revenue so a provider can determine how a specific service billed can affect the overall monthly income.

I.e. Avg income is 10,000, but if they add a career discovery service (5 units or whatever), the graph will show how much the increase is.

 

Thanks again!


  • swinings wrote:

    Total Amount/New Measure = (chosen rate/filter) * ((Number of Days/Weeks/Months * Number of Units Per Day/Week/Month) * Number of People Receiving Service)

     

    I'm looking for the first part of the DAX code (the chosen rate/filtered info).

     


    If I understand your issue correctly you should be able to do this using the SELECTEDVALUE() function.

     

    Something like SELECTEDVALUE( '<your table>'[Rate] ) would give you the current filter selection for the [Rate] column. You can also optionally specify a default value if nothing is selected, but if you don't do this it just returns BLANK() 

2 Replies


  • swinings wrote:

    Total Amount/New Measure = (chosen rate/filter) * ((Number of Days/Weeks/Months * Number of Units Per Day/Week/Month) * Number of People Receiving Service)

     

    I'm looking for the first part of the DAX code (the chosen rate/filtered info).

     


    If I understand your issue correctly you should be able to do this using the SELECTEDVALUE() function.

     

    Something like SELECTEDVALUE( '<your table>'[Rate] ) would give you the current filter selection for the [Rate] column. You can also optionally specify a default value if nothing is selected, but if you don't do this it just returns BLANK() 

  • Anonymous's avatar
    Anonymous
    Not applicable

    swinings 

    You create a distinct table for the rate column as the new slicer, it must be disconnect to the main table.

    Slicer rate = Distinct(Table[rate])

     

    Then use selectedvalue() to call out the filtered rate.

    Measure = Selectedvalue(Slicer Table[rate]) * ((Number of Days/Weeks/Months * Number of Units Per Day/Week/Month) * Number of People Receiving Service)

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.