Forum Discussion

derekli17001's avatar
derekli17001
Helper I
2 years ago
Solved

How to make a table count values until slicer is selected

This is my excel sheet

On my dashboard- i have 3 customers and the same items with varying conditions of either yes or no. I want it so that when no slicers for specific customers (column c) are selected - i want my table to show like below as a count of all customers":

However, when a customer slicer is selected - it will show whether the selected customer has the item via yes or no as shown in my excel sheet. Thanks. How do i do this?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, derekli17001 

    Try the following DAX:

    Measure = 
    IF(ISFILTERED('Table'[Customer]),
    SELECTEDVALUE('Table'[INCLUDE]),
    COUNT('Table'[INCLUDE])
    )

    In the case that no customer is selected

    While choosing a customer to slice

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

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

5 Replies

  • Not sure I understand what you want. Can you give us a sample of what your expected results would look like?

    • derekli17001's avatar
      derekli17001
      Helper I

      This is an example of what my current dashboard looks like when no slicer is selected:


      When i select a customer on a slicer, i will get a respective yes or no for each item as seen below:

      I want it so that when there is no slicer selected - i will get a number of each item for every customer (as shown below) and will only get yes/no when a slicer is selected



      I have attached the dataset i used below:

      ITEMINCLUDECustomer
      Appointment as Caltex DistributorYesKel Campbell
      Distributor Licensed Area - Selective ZoneYesKel Campbell
      Sale or assignmentYesKel Campbell
      Caltex BrandYesKel Campbell
      PremisesYesKel Campbell
      Equipment providedYesKel Campbell
      IT SystemNoKel Campbell
      OPT software and marksYesKel Campbell
      Caltex CardYesKel Campbell
      Distributor CardYesKel Campbell
      TrainingYesKel Campbell
      Contribution to advertising/promotionsYesKel Campbell
      Investment allowanceYesKel Campbell
      Service Fee WorkYesKel Campbell
      Credit/deferred payment termsYesKel Campbell
      Commission agency for Depot FrontNoKel Campbell
      Appointment as Caltex DistributorYesBonney
      Distributor Licensed Area - Selective ZoneYesBonney
      Sale or assignmentYesBonney
      Caltex BrandYesBonney
      PremisesYesBonney
      Equipment providedYesBonney
      IT SystemNoBonney
      OPT software and marksYesBonney
      Caltex CardYesBonney
      Distributor CardYesBonney
      TrainingYesBonney
      Contribution to advertising/promotionsYesBonney
      Investment allowanceYesBonney
      Service Fee WorkYesBonney
      Credit/deferred payment termsYesBonney
      Commission agency for Depot FrontYesBonney
      Appointment as Caltex DistributorYesGeraldton
      Distributor Licensed Area - Selective ZoneYesGeraldton
      Sale or assignmentYesGeraldton
      Caltex BrandYesGeraldton
      PremisesYesGeraldton
      Equipment providedYesGeraldton
      IT SystemNoGeraldton
      OPT software and marksYesGeraldton
      Caltex CardYesGeraldton
      Distributor CardYesGeraldton
      TrainingYesGeraldton
      Contribution to advertising/promotionsYesGeraldton
      Investment allowanceYesGeraldton
      Service Fee WorkYesGeraldton
      Credit/deferred payment termsYesGeraldton
      Commission agency for Depot FrontYesGeraldton
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, derekli17001 

    You may want to consider using Bookmark, as follows:

    Create a bookmark and bind it to a Button. Create two tables on the original page, one with count and one with Yes or No. Use Bookmark to record the status of All and hide another table.

     

     

    To return to the status of selecting a customer, click another Button.

     

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

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

     

    • derekli17001's avatar
      derekli17001
      Helper I

      Is there a fomula/conditional column option rather than using bookmarks?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi, derekli17001 

        Try the following DAX:

        Measure = 
        IF(ISFILTERED('Table'[Customer]),
        SELECTEDVALUE('Table'[INCLUDE]),
        COUNT('Table'[INCLUDE])
        )

        In the case that no customer is selected

        While choosing a customer to slice

         

        How to Get Your Question Answered Quickly 

        Best Regards

        Yongkang Hua

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