Search code examples
powerbidaxpowerbi-desktopmeasure

How to Create a Measure that works Against Whatever the Selected Row Is?


I have a simple table in Power BI Desktop:

       | Total | YTD
=======|=======|======
Sally  | 100   | 20      
Bob    | 15    | 3
Joe    | 47    | 36
=======|=======|======
Totals | 162   | 59

I also have a Gauge for this data and I'd like to be able to have the gauge show only the data for the selected row in the table. That part works, but I need to have the gauge have a target that is .95 of the value in the Total column for the selected row. For example, if the user selects the Bob row, I need the gauge to use 14.25 (15 * .95) as the target. But if the user selects the Sally row, the Gauge target should be 95 (100 + .95).

I believe that I need a measure to make this work, but I am stuck on how to set the measure up so that it will be dynamic:

Target = .95 * [What would go here?]

Thanks for your guidance.


Solution

  • Target = 0.95 * SUM('Table'[Total])