Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am using a box and whiskers graph to show some data but this data has a range of outliers so I want to be able to filter the graph by standard deviation as selected by the user.
I have created a table and off that table a slicer so the user can select between 1 and 20 standard deviations
Table: StandardDeviation
Slicer:
In my KeyMeasures Table I have created a measure:
STDValue = SELECTEDVALUE( StandardDeviation[STD] , 0 )
Standard Deviation - Calculated Column
STD-AtoB = STDEV.P(Visits[AtoB (Minutes)])
When I use the above STD-AtoB and multiply it by 4 std it works but if I try to pass the slicer value [STDValue] it returns 0
ScaledX4-AtoB =
VAR Mean = AVERAGE(Visits[AtoB (Minutes)])
RETURN
IF(
Visits[AtoB (Minutes)] > Mean + Vists[STD-AtoB] * 4,
Mean + Vists[STD-AtoB] * 4,
Visits[AtoB (Minutes)]
)
with slicer value:
ScaledX4-AtoB =
VAR Mean = AVERAGE(Visits[AtoB (Minutes)])
RETURN
IF(
Visits[AtoB (Minutes)] > Mean + Vists[STD-AtoB] * [STDValue],
Mean + Vists[STD-AtoB] * [STDValue],
Visits[AtoB (Minutes)]
)
I broke down the calculation to see if it would return the value and it returns 4 as selected in the slicer, so why won't it multiply in my above calculation?
ScaledX4-AtoB
Scaled-TriagetoDMC =
RETURN
[STDValue]
I have tried moving the slicer value to the visits table and the key measures table, and taking it directly from the StandardDeviation table and even changing it to a calculated column in the Visits table
Using max/sum only gave me the max/sum of the (StandardDeviation[STD]) column.
There is too much sensitive data to post my analytic
Solved! Go to Solution.
It should be possible as a measure but will need to be adjusted. I don't quite follow how it's supposed to work, so it's hard to suggest something specific but this might get you closer:
ScaledX4-AtoB =
VAR Mean = CALCULATE ( AVERAGE ( Visits[AtoB (Minutes)] ), ALLSELECTED () )
VAR CurrAB = AVERAGE ( Visits[AtoB (Minutes)] )
VAR SD = CALCULATE ( [STD-AtoB], ALLSELECTED () )
VAR SlicerSTD = [STDValue]
RETURN
IF ( CurrAB > Mean + SD * SlicerSTD, Mean + SD * SlicerSTD, CurrAB )
Yes I am, which makes sense now.
Can I still do what I am trying to do in this as a measure?
ScaledX4-AtoB =
VAR Mean = AVERAGE(Visits[AtoB (Minutes)])
RETURN
IF(
Visits[AtoB (Minutes)] > Mean + Vists[STD-AtoB] * [STDValue],
Mean + Vists[STD-AtoB] * [STDValue],
Visits[AtoB (Minutes)]
)
It should be possible as a measure but will need to be adjusted. I don't quite follow how it's supposed to work, so it's hard to suggest something specific but this might get you closer:
ScaledX4-AtoB =
VAR Mean = CALCULATE ( AVERAGE ( Visits[AtoB (Minutes)] ), ALLSELECTED () )
VAR CurrAB = AVERAGE ( Visits[AtoB (Minutes)] )
VAR SD = CALCULATE ( [STD-AtoB], ALLSELECTED () )
VAR SlicerSTD = [STDValue]
RETURN
IF ( CurrAB > Mean + SD * SlicerSTD, Mean + SD * SlicerSTD, CurrAB )
Perfect, thank you 😊
Are you trying to use [STDValue] in a calculated column? (Calculated columns cannot read slicers.)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
26 | |
20 | |
14 | |
8 |
User | Count |
---|---|
73 | |
47 | |
45 | |
17 | |
17 |