Forum Discussion

jka99's avatar
jka99
Regular Visitor
3 years ago

Default Slicer Value from Matrix

Hello all.

 

I have areport I'm building to show shortages. I am tracking quantity on hand and days on hand across an enterprise and at a local level. I have a matrix that shows the 5 items with the lowest number of days on hand. I have a slicer containing all items driving outputs on other visualizations.

 

My question is this- is there a way to use the top value from the matrix as the default value for a slicer?

2 Replies

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi jka99 

     

    If I understand it correctly, you want to show the same top 5 items in the item slicer, right? If so, you need to add a filter on the slicer. May I know how do you show the top 5 items in the matrix currently? Is it based on a measure or a column? If it is ranked by a column, you can try adding that column to the visual-level filter pane of the slicer, and selecting Top N filter type to filter the items. For example,

     

    If it is ranked by a measure, you need to create another measure to work as a filter field. In this scenario, we need to know how the data looks like and what the measure formula is. One mode of the measure is like below. Add this measure to the visual-level filter pane of the slicer and make it show items when value is 1.

    Flag =
    VAR _top5 =
        TOPN (
            5,
            VALUES ( DimProduct[Color] ),
            CALCULATE ( SUM ( FactInternetSales[SalesAmount] ) )
        )
    RETURN
        IF ( SELECTEDVALUE ( DimProduct[Color] ) IN _top5, 1, 0 )
    

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.

  • jka99's avatar
    jka99
    Regular Visitor
     
     

    That's not exactly what I'm doing. Apologies for not being clearer. My slicer has all the medications I am tracking. My matrix has the top five with the lowest days on hand. My goal is for the slicer to default to the top number in that matrix so all other visualizations on the page (that are subject to the filter from the slicer) start on that view. Otherwise my graphs show days on hand for all products, which is meaningless.

     

    Here's the matrix:

     

    Based on that, I'd like my slicer to default to heparin. If metronidazole slipped below that in terms of days on hand and became the top problem, then that would be the starting point on the slicer when the report was opened. This will be host on SharePoint, if that makes any difference.