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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
jsuttmann
Helper I
Helper I

Slicer Based on Count

I need help building a slicer that is based on a count of transactions per user.  My dataset has a column of users and a column of transaction IDs.  I have a visual showing all the distinct users in my dataset and a count of transaction IDs associated to each user.  I want to build a slicer that allows me to define a minimum count of transaction IDs to display in the visual.  For example, if my slicer is set to a minimum count of 3 transaction ID, my visual would exclude users with counts of 1 or 2 transaction IDs.  

1 ACCEPTED SOLUTION
jgeddes
Solution Sage
Solution Sage

You could accomplish this with a parameter.

For example if I want to limit the count of services from my table

jgeddes_0-1664559344428.png

I can create a parameter named "Minimum TXs" and then write my measure as follows

Count of Services =
var _serviceCount =
COUNT(clientTable[ServiceName])
var _minTXs =
'Minimum TXs'[Minimum TXs Value]
var _table =
FILTER(clientTable, clientTable[ServiceName])
Return
IF(
    _serviceCount >= 'Minimum TXs'[Minimum TXs Value],
    SUMX(FILTER(SUMMARIZE(clientTable, clientTable[Client_Name], "_count", COUNT(clientTable[ServiceName])), [_count] > 'Minimum TXs'[Minimum TXs Value]),[_count]),
    BLANK()
)

I would then end up with 

jgeddes_2-1664559447810.png 

jgeddes_0-1664560584012.png

Hope this points you in the right direction.

 

View solution in original post

1 REPLY 1
jgeddes
Solution Sage
Solution Sage

You could accomplish this with a parameter.

For example if I want to limit the count of services from my table

jgeddes_0-1664559344428.png

I can create a parameter named "Minimum TXs" and then write my measure as follows

Count of Services =
var _serviceCount =
COUNT(clientTable[ServiceName])
var _minTXs =
'Minimum TXs'[Minimum TXs Value]
var _table =
FILTER(clientTable, clientTable[ServiceName])
Return
IF(
    _serviceCount >= 'Minimum TXs'[Minimum TXs Value],
    SUMX(FILTER(SUMMARIZE(clientTable, clientTable[Client_Name], "_count", COUNT(clientTable[ServiceName])), [_count] > 'Minimum TXs'[Minimum TXs Value]),[_count]),
    BLANK()
)

I would then end up with 

jgeddes_2-1664559447810.png 

jgeddes_0-1664560584012.png

Hope this points you in the right direction.

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.