Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

adding counts to slicer

Hi again guru's.

 

I have been asked to update a power BI dashboard to add a count to a slicer.

 

What I have at the moment is a standard slicer (See pic1 below ) - a slicer with a number of categories.

 

What I would like to have is the same but with counts on each slicer.  Is this even possisble?

I can create a card so when I click on one of the caterory boxs above, the card shows the count - but I would like to have that count in the category slicer.

 

Something like the below example

 

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi both, sorry for the delayed response.

    The above has done what I wanted but now I am after an additional piece of help.

     

    I created a new table and used that as the slicer - it works in that it gives the sum / count of the attributes,

    However, when I click on a different attribute to slice / filter my visuals, this total remains static (as I assume it is a calculation based on the raw data only).

     

    Is there a way to make this calculation dynamic?

     

    Code of current table counter I created...


    Open_Items_counter_items =
    SUMMARIZE (
        Table1,
        Table1[Category],
        "_CategoryCount"COUNT ( Table1[Category] ) + COUNTBLANK ( Table1[Category] ),
        "_Category_count"SUM ( Table1[Counts] ) - SUM ( Table1[<1Year] ),
        "_CategoryNameCount",
            CALCULATE (
                IF (
                    ISBLANK ( VALUES ( Table1[Category] ) ),
                    "Blank()",
                    VALUES ( Table1[Category] )
                ) & " ("
                    COUNT ( Table1[Category] ) + COUNTBLANK ( Table1[Category] ) & ")"
            ),
        "_CategoryNameCount2",
            CALCULATE (
                IF (
                    ISBLANK ( VALUES ( Table1[Category] ) ),
                    "Blank()",
                    VALUES ( Table1[Category] )
                ) & " ("
                    SUM ( Table1[Counts] ) - SUM ( Table1[<1Year] ) & ")"
            )
    )