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

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.

Reply
Anonymous
Not applicable

Getting a custom slicer

Hi,

 

I have two slicers, both which filter data on numerical value columns. I don't wish to have range, just a single cell for each of the slicers where a user inputs the two values and i get the data which follows any one of the conditions.

I have tried the greater than visual but it still gives two boxes and greys out the maximum one which doesn't look tidy. Is there anything else possible?

 

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can roughly understand your requirement, I think you can achieve this using two calculated tables and a measure, you can try my steps:

  1. Create two calculated tables like this:

 

Slicer1 = SUMMARIZE('Data',[Value])
Slicer2 = SUMMARIZE('Data',[Value])

 

  1. Create a measure like this:

 

Flag =

var _range1=ALLSELECTED(Slicer1[Value])

var _range2=ALLSELECTED(Slicer2[Value])

return

IF(MAX('Data'[Value]) in _range1||MAX('Data'[Value]) in _range2,1,0)

 

  1. Then you can create two slicers to place the two new table columns and a table chart to apply a visual filter on this chart like this:

v-robertq-msft_0-1623828909603.png

 

 

And you can get what you want, like this:

v-robertq-msft_1-1623828909605.png

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @Anonymous 

According to your description, I can roughly understand your requirement, I think you can achieve this using two calculated tables and a measure, you can try my steps:

  1. Create two calculated tables like this:

 

Slicer1 = SUMMARIZE('Data',[Value])
Slicer2 = SUMMARIZE('Data',[Value])

 

  1. Create a measure like this:

 

Flag =

var _range1=ALLSELECTED(Slicer1[Value])

var _range2=ALLSELECTED(Slicer2[Value])

return

IF(MAX('Data'[Value]) in _range1||MAX('Data'[Value]) in _range2,1,0)

 

  1. Then you can create two slicers to place the two new table columns and a table chart to apply a visual filter on this chart like this:

v-robertq-msft_0-1623828909603.png

 

 

And you can get what you want, like this:

v-robertq-msft_1-1623828909605.png

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi,

 

Thank you for this. The solution feels like almost close but it's not working exactly.

 

Since i have two slicers created for two of my columns.

 

Slicer 1 which is linked to column A

Slicer 2 Which is linked to column B

 

Then the flag logic is something which i am not able to understand.

 

In the table i am actually getting Name and then these Column A & B to check if its working. But the selection doesn't seem to work.

The table in the visual i am referring to the original file column A & B whereas the slicers are coming from the slicer1 and slicer 2.

 

I don't seem to understand the max logic with it.

If slicer1 selections gives range of min and max

slicer 2 gives its own range of min and max

We are referring to max of the original column in range of slicer (min, max) || max of second original column in range of slicer2. 

If i had Table like

 

          Column A        Column B

ABC     50                      0

ABC     100                     20

DEF       100                  0 

DEF      0                        0

 

I would see two rows such as 

ABC      150           20

DEF       100            0

 

So if a slicer for 1 is given as 110 and for slicer 2 is given as 0, i should get both the entries 

If its 100 and 10 , then only ABC should be seen.

 

parry2k
Super User
Super User

@Anonymous you can create two what-if parameters and turn off slider, it will leave with a box to input the value:

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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