• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Filter matrix based on a slicer which is based on a measure

learner101

New Member
hi, i have a matrix visual which contains the current month demand, current_month + 1 demand, difference between the 2 in absolute quantities and percentage difference. All measures in this table are switch measures so that the user can use to switch between quantity and value.
to avoid infinity, i have capped the %age to 999.

DynamicDemandChange_ABS_% =
VAR SelectedMeasure =
SWITCH(
[SelectedOption],
"Units", [DEMAND_CHANGE_%_ABS],
"$", [DEMAND_CHANGE_%_ABS_DOLLARS]
)
RETURN
IF(
SelectedMeasure > 9 || NOT(ISNUMBER(SelectedMeasure)),
9.99,
SelectedMeasure
)
The requirement is to provide a slicer where the user can slice between 0 and 999 to review differences as filtere by this slicer.
I have tried the following :
1. percentage_sliver : create a table using GENERATESERIES(0,9.99,0.1). I tried using max(DynamicDemandChange_ABS_%) instead of 9.99 but it did not generate the series. Hence i hard coded the min-max to 0 and 9.99. Ideally i would want to replace 9.99 with max(DynamicDemandChange_ABS_%) but it is not working.
would like for the below to work but is only giving 0, 0.01, 0.02 in the series. i know that i have %age upto 999%
LAG1_FILTER =
VAR MaxValue = CALCULATE([DEMAND_CHANGE_%_ABS_LAG1], ALL())
RETURN
GENERATESERIES(0, MaxValue, 0.01)

Hence i changed the above code to

LAG1_FILTER =
VAR MaxValue = CALCULATE([DEMAND_CHANGE_%_ABS_LAG1], ALL())
RETURN
GENERATESERIES(0, 9.99, 0.01)


2. Next step i created a measure
Lag1_filter =
VAR MIN_VALUE = 0
VAR MAX_VALUE = 999
VAR CURRENTMEASUREVALUE = [DEMAND_CHANGE_%_ABS]
RETURN
IF (
CURRENTMEASUREVALUE >= MIN_VALUE && CURRENTMEASUREVALUE <= MAX_VALUE,
1,
0
)
i have added a IF condition to check the slicer is working. but wven when slide the slicer to contain the range or elimiate some range of percentages, the measure is not filtered.

how do I get my slicer working? when i remove the cap of 9.99, then the only value for which the slicer is working is infinity.


sandy_PBI_0-1735191775145.png



sandy_PBI_1-1735191952550.png


appreciate any pointers.
thanks.
 
It looks like your slicer is not using percentages but plain numbers. All your percentage values sit between 0 and 10, not 0 and 999.
 
Back
Top