Forum Discussion
Measure doesnt work as expected inside VAR
- 1 year ago
ipezakas Create the measures for thresholds:
DAX
TopThreshold =
PERCENTILEX.INC(
FILTER(ALLSELECTED(Projects), Projects[TIME_TO_MARKET_(TtM)] >= 0),
Projects[TIME_TO_MARKET_(TtM)],
1 - [Percentile] / 100
)BottomThreshold =
PERCENTILEX.INC(
FILTER(ALLSELECTED(Projects), Projects[TIME_TO_MARKET_(TtM)] >= 0),
Projects[TIME_TO_MARKET_(TtM)],
[Percentile] / 100
)Create a measure for the outlier flag:
DAX
(TtM) Outlier Flag Measure =
VAR CurrentTtM = SELECTEDVALUE(Projects[TIME_TO_MARKET_(TtM)])
VAR BottomThreshold = [BottomThreshold]
VAR TopThreshold = [TopThreshold]
RETURN
IF(
NOT ISBLANK(CurrentTtM) &&
(CurrentTtM < BottomThreshold || CurrentTtM > TopThreshold),
1,
0
)Add the (TtM) Outlier Flag Measure to your visual table. This measure will dynamically calculate the flag based on the current filter context applied to the visual.
ipezakas Create the measures for thresholds:
DAX
TopThreshold =
PERCENTILEX.INC(
FILTER(ALLSELECTED(Projects), Projects[TIME_TO_MARKET_(TtM)] >= 0),
Projects[TIME_TO_MARKET_(TtM)],
1 - [Percentile] / 100
)
BottomThreshold =
PERCENTILEX.INC(
FILTER(ALLSELECTED(Projects), Projects[TIME_TO_MARKET_(TtM)] >= 0),
Projects[TIME_TO_MARKET_(TtM)],
[Percentile] / 100
)
Create a measure for the outlier flag:
DAX
(TtM) Outlier Flag Measure =
VAR CurrentTtM = SELECTEDVALUE(Projects[TIME_TO_MARKET_(TtM)])
VAR BottomThreshold = [BottomThreshold]
VAR TopThreshold = [TopThreshold]
RETURN
IF(
NOT ISBLANK(CurrentTtM) &&
(CurrentTtM < BottomThreshold || CurrentTtM > TopThreshold),
1,
0
)
Add the (TtM) Outlier Flag Measure to your visual table. This measure will dynamically calculate the flag based on the current filter context applied to the visual.
Is it possible to make this work as a calculated column as well? Cause when i am trying to use it as filter inside a column chart the visuals breaks.