Forum Discussion
Percentage Slicer (slider)
- 1 year ago
Hi Gao
I've now resolved the issue.
I wrote some SQL to get a percentage distinct datset and created the numbers from 0.01 to 100.
I then created a % adjusted measure in my main dataset components[% Adjusted] by using these columns CALCULATE([# Total Adjusted]/[# Total Components] )
I then created a measure (see below) based on some of the responses to this thread (thank you everyone)
% Adjusted For Slider Link =VAR sliderstart = MIN(percentagelist[% Adjusted]) - this is from my SQL datasetVAR sliderend = MAX(percentagelist[% Adjusted]) - this is from my SQL datasetVAR result = components[% Adjusted] - this is from my main datasetRETURNIF( result >= sliderstart && result <= sliderend, result+0)I then added percentagelist[% Adjusted] to each of my tables as well as to the slider .Works a treat.Hope makes senseThank you everyone. Great team work 😊Kind regardsKaren
Hi KarenFingerhut ,
What about dividing by 100 like this and comparing it to the original measure?
newMeasure =
VAR __min_value = DIVIDE(MIN('Slider'[Value]),100)
VAR __max_value = DIVIDE(MAX('Slider'[Value]),100)
VAR __metric = [Measure]
VAR __result = IF(__metric>=__min_value && __metric<=__max_value,__metric)
RETURN
__result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- KarenFingerhut1 year agoResponsive Resident
Hi Gao
I've now resolved the issue.
I wrote some SQL to get a percentage distinct datset and created the numbers from 0.01 to 100.
I then created a % adjusted measure in my main dataset components[% Adjusted] by using these columns CALCULATE([# Total Adjusted]/[# Total Components] )
I then created a measure (see below) based on some of the responses to this thread (thank you everyone)
% Adjusted For Slider Link =VAR sliderstart = MIN(percentagelist[% Adjusted]) - this is from my SQL datasetVAR sliderend = MAX(percentagelist[% Adjusted]) - this is from my SQL datasetVAR result = components[% Adjusted] - this is from my main datasetRETURNIF( result >= sliderstart && result <= sliderend, result+0)I then added percentagelist[% Adjusted] to each of my tables as well as to the slider .Works a treat.Hope makes senseThank you everyone. Great team work 😊Kind regardsKaren