cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Using a Measure as an Error Bar to Show a Dynamic Value

Hi, I have a pretty complicated plot and tables, but I will do my best to explain it. Essentially, I have a problem with using a custom measure for an error bar to show a dynamic value.

I have four tables: Cross Section Coordinates, Instrument Details, Sample Point, and VWP. There are five different cross sections that I have plotted using Chainage on the y-axis and Elevation on the x-axis from the Cross Section Coordinates table according to the legend values 'Static Plot'. I made a slicer titled Cross Section to display each of them.

Each cross section has different instruments. The instruments are plotted in the cross section plot as Tip Levels. When a cross section is selected in the Cross Section slicer, the Instrument slicer will automatically display the instruments available for that cross section. When an instrument is selected from that slicer, an error bar will be displayed, showing the range of the RLm value of that instrument. To select another cross section, you have to unselect all the instruments first.

Each instrument has RLm values that are stored in the VWP table as a column. I used error bars to display the maximum and minimum values of the RLm for each instrument on the same y-axis value as the Tip Levels. I created two measures as the fields for the upper bound and lower bound.

For the upper bound, I created the measure max_rlm:

max_rlm =
if(SELECTEDVALUE('Cross Section Coordinates'[Chainage (m)]) == SELECTEDVALUE('Sample Point'[Cross section chainage]), max('VWP'[RLm]), 0)

For the lower bound, I created the measure min_rlm:

min_rlm =
if(SELECTEDVALUE('Cross Section Coordinates'[Chainage (m)]) == SELECTEDVALUE('Sample Point'[Cross section chainage]), min('VWP'[RLm]), 0)

These measures compare the value of the cross section chainage of the selected instrument in the Sample Point table to the cross section chainage values in the Cross Section Coordinates table. If they are the same, the respective maximum/minimum values will be shown for that instrument, otherwise nothing will be shown. There is an established Many-to-Many relationship between the cross section column in the Cross Section Coordinates table and the cross section column in the Sample Point table.

Currently, when an instrument is chosen, only 1 pair of upper and lower bound can be shown on a cross section. When 2 or more instruments are selected, the error bars no longer show up. I want to display all of the upper and lower bounds for all the instruments for every cross section. How do I modify max_rlm and min_rlm to achieve this?

Many Thanks,
Samantha

3 REPLIES 3
Frequent Visitor

In that case, is there a DAX function that can take account more than one item to replace SELECTEDVALUE?

Thanks

Super User

Depends on your situation, for example VALUES ()

Super User

SELECTEDVALUE won't work if you have less than or more than one item selected.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

#### Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors