Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JacoMathew
Frequent Visitor

Need help with measure to get the filter value

Hi All,

 I have a simple a slicer with list of Products and 2 Bar charts with Products and total quantity. I have turned off the interaction between the Product slicer and one of the bar chart. My requirement is to give a different colour to the slicer selected product in the barchart. I was thinking of writing a measure that would give a different Hex code if the Product in the bar chart is same as the selected value in the slicer. But I can't seem to get it to work.

JacoMathew_1-1682199325356.png

 

I wrote this measure to get the slicer selected value in the barchart (as a tooltip) but doesn't give the correct value.

Filter selected =

 

CALCULATE(
    MIN('Table'[product]),
    ALLSELECTED('Table'[product])
)

I also tried selectedvalue() instead of Min() but got blank result.

 

Please suggest a correct measure that would let me get the slicer selected product in the Product by quantity barchart.

Thanks

Jaco

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

color.pbix

 

ThxAlot_1-1682241859151.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

4 REPLIES 4
JacoMathew
Frequent Visitor

Thank you @ThxAlot @Ahmedx for the suggestion. I was aware that a separate dimension could be a possible solution, I was more curious on why the ALLSELECTED() wasn't working. Per my understanding, ALLSELECTED() should have retained the Product from the slicer (external of visual) but ignore the row level filter of Product from the visual.

Please note that my model had interaction turned off between the slicer and the bottom barchat. @ThxAlot If I do this in your setup, then the colouring fails.

Any idea why the measure that I had written in the post is failing ?

Thanks,

Jaco

read about Auto Exist

ThxAlot
Super User
Super User

color.pbix

 

ThxAlot_1-1682241859151.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Ahmedx
Super User
Super User

you have to create a separate dimension table for the slicer,
and only then will you succeed

DimProduct= DISTINCT(Table'[product])

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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