I am a new user of Power BI and am having an issue getting a visual to work.
The table below has fixed values for X and Y is calculated using the formula shown.
The Parameter[Value] is varied by a slider, shown below.
But changing the slider value does not change the table values.
Is there a way to do this?
First, you should know that:
1. Calculation column/table not support dynamic changed based on filter or slicer.
2. Measure can be affected by filter/slicer, so you can use it to get dynamic summary result in a visual.
Second, for your case, you just could just create a simple measure as below:
Y = SUM('Table'[X]) - 'Parameter'[Value]
And then drag this measure into visual.
and here is sample pbix file, please try it.
Thanks for your response.
The sample file contained what I was looking for.
Coming from an excel background the DAX language and operation is a bit confusing .
Is the Y measure below storing the results in an array?
No, measure will calculate by it row context in a visual. It likes you define a function, then call it by row text in a visual.
Calculated columns are calculated at load and not affected by slicers and report interactions. You need a measure.
Y = VAR CurrentXValue = MAX('Table'[X]) VAR Result = CurrentXValue - [Selected Value] RETURN Result
You can see my PBIX file here.
Calculated columns appear to be very Excel-like, but they are anything but, and should generally be avoided. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.