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
bimagty
Frequent Visitor

Use slicer with count of item's categories

Hi, 

I want to use slicer by using count of item's category, here is the table example:

 

bimagty_0-1653877661327.png

 

As we see, for Place like AB01 has total 2 bands which are LTE900 and LTE1800 meanwhile BC02 has 3 bands, CD03 has 4 bands, etc..

How can I use slicer to filter i.e. only showing Place with 3 bands (or something like that)?

I already try with 

= countrows(values('Place')

But it still seems wrong.

 

Really hope and appreciate for your help. Thanks in advance! 

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

Hi @bimagty ,

 

You can use What if parameter in power bi to change the bands number.

 

And use this measure to do that.

Measure =
VAR _number =
    SELECTEDVALUE ( 'Band'[Band] )
RETURN
    IF (
        CALCULATE ( COUNTROWS ( 'Table' ), ALLSELECTED ( 'Table'[Band] ) ) = _number,
        1
    )

And put the measure in filter pane on this table visual and set it show itmes which is 1.

 

Result:

vchenwuzmsft_0-1654165944057.png

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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
v-chenwuz-msft
Community Support
Community Support

Hi @bimagty ,

 

You can use What if parameter in power bi to change the bands number.

 

And use this measure to do that.

Measure =
VAR _number =
    SELECTEDVALUE ( 'Band'[Band] )
RETURN
    IF (
        CALCULATE ( COUNTROWS ( 'Table' ), ALLSELECTED ( 'Table'[Band] ) ) = _number,
        1
    )

And put the measure in filter pane on this table visual and set it show itmes which is 1.

 

Result:

vchenwuzmsft_0-1654165944057.png

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

tamerj1
Super User
Super User

Hi @bimagty 

yes you can create a separate filter table containing the numbers 1, 2, 3, etc. then you filter measure would be

=if ( countrows(values('Place') ) = MAXX ( ALLSELECTED ( FilterTable), FilterTable[Number of Brands] ), 1 )

this measure can be placed in the filter pane and you shall select "is equal" and type 1 as a value then spply the filter. 

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.

Top Solution Authors