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
Shardul_Dolas
New Member

Show One Min and One Max Amount on Slicer Selection

Hi,

 

I want to show the one Max and One Min Amount on slicer selection on Grid (Table).

I have Product, Category, Subcategory, Country, Min Amount and Max Amount, these columns available on my grid.

On one slicer I have created a hierarchy of Product and Category and on another slicer I have created the hierarchy of Region and Country. 

When I select the Product from the slicer it should show One Min and One Max value, same goes for Region, and country as well. I want to see only two rows (Min and Max value) on my grid.

 

TIA

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

Hi @Shardul_Dolas 

 

Perhaps the following can help.

 

My sample:

vxuxinyimsft_0-1709273039548.png

 

1. Create two Calculated tables as slicer table

Product = SELECTCOLUMNS('Table', "Product", [Product], "Category", [Category])
Region = SELECTCOLUMNS('Table', "Region", [Region], "Country", [Country])

 

2. Create a measure as follows

measure = 
VAR _maxValue = CALCULATE(MAX([Value]), FILTER(ALL('Table'), [Product] = SELECTEDVALUE('Product'[Product]) && [Category] = SELECTEDVALUE('Product'[Category]) || [Region] = SELECTEDVALUE(Region[Region]) && [Country] = SELECTEDVALUE(Region[Country])))
VAR _minValue = CALCULATE(MIN([Value]), FILTER(ALL('Table'), [Product] = SELECTEDVALUE('Product'[Product]) && [Category] = SELECTEDVALUE('Product'[Category]) || [Region] = SELECTEDVALUE(Region[Region]) && [Country] = SELECTEDVALUE(Region[Country])))
RETURN
IF(MAX([Value]) = _maxvalue || MAX([Value]) = _minvalue, 1, 0)

 

 3. Put the measure into the visual-level filters, set up show items when the value is 1.

vxuxinyimsft_3-1709273613182.png

 

vxuxinyimsft_2-1709273582809.png

Is this the result you expect?

 

If I've misunderstood you, please provide detailed sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account. We can better understand the problem and help you.

 

Best Regards,
Yulia Xu

 

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

2 REPLIES 2
Shardul_Dolas
New Member

Thanks, for the solution

v-xuxinyi-msft
Community Support
Community Support

Hi @Shardul_Dolas 

 

Perhaps the following can help.

 

My sample:

vxuxinyimsft_0-1709273039548.png

 

1. Create two Calculated tables as slicer table

Product = SELECTCOLUMNS('Table', "Product", [Product], "Category", [Category])
Region = SELECTCOLUMNS('Table', "Region", [Region], "Country", [Country])

 

2. Create a measure as follows

measure = 
VAR _maxValue = CALCULATE(MAX([Value]), FILTER(ALL('Table'), [Product] = SELECTEDVALUE('Product'[Product]) && [Category] = SELECTEDVALUE('Product'[Category]) || [Region] = SELECTEDVALUE(Region[Region]) && [Country] = SELECTEDVALUE(Region[Country])))
VAR _minValue = CALCULATE(MIN([Value]), FILTER(ALL('Table'), [Product] = SELECTEDVALUE('Product'[Product]) && [Category] = SELECTEDVALUE('Product'[Category]) || [Region] = SELECTEDVALUE(Region[Region]) && [Country] = SELECTEDVALUE(Region[Country])))
RETURN
IF(MAX([Value]) = _maxvalue || MAX([Value]) = _minvalue, 1, 0)

 

 3. Put the measure into the visual-level filters, set up show items when the value is 1.

vxuxinyimsft_3-1709273613182.png

 

vxuxinyimsft_2-1709273582809.png

Is this the result you expect?

 

If I've misunderstood you, please provide detailed sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account. We can better understand the problem and help you.

 

Best Regards,
Yulia Xu

 

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

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.