Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Return Accumulate distinct count and make multiple selection slicer work on the same page

I am trying to accumulate distinct count of many numbers and use a slicer to control the chart.

 

Below is the data structure and two results I hope to get.

Customer_IDEvent_NameOrder StatusWeeks_Before_DueGenderUniqle ID
A001Paris, 2016Done0Female2016_A001
A002Paris, 2016Done0Male2016_A002
A003Paris, 2016Done1Female2016_A003
A004Paris, 2016Done2Male2016_A004
A007Paris, 2016Cancel2Male2016_A007
A008Paris, 2016Done3Female2016_A008
A010Paris, 2016Done5Female2016_A010
A002Chicago, 2017Done0Male2017_A002
A004Chicago, 2017Done0Male2017_A004
A005Chicago, 2017Done0Female2017_A005
A006Chicago, 2017Done2Female2017_A006
A007Chicago, 2017Done3Male2017_A007
A008Chicago, 2017Done6Female2017_A008
A001Tokyo, 2018Done0Female2018_A001
A003Tokyo, 2018Done2Female2018_A003
A004Tokyo, 2018Cancel3Male2018_A004
A006Tokyo, 2018Done3Female2018_A006
A007Tokyo, 2018Done3Male2018_A007
A008Tokyo, 2018Done4Female2018_A008
A009Tokyo, 2018Done5Male2018_A009
A010Tokyo, 2018Done5Female2018_A010
      
      
      

There are three events and several cutomers attended those events, a customer can attend more than one event.

 

Attendees can start to pay for the tickets six weeks before the event start, so zero means they pay on site when event begin. 

 

Cancel records should be excluded.

 

I started by creating some unique IDs and created a seperate table with ALL(EVENT_NAME,WEEKS_BEFORE_DUE) and CALCULATE(DISTINCTCOUNT(CUSTOMER_ID). It works when users only select one option in slicer (scenario 1).

 

Yet, when users need to choose more than one, an error happened. Also, I don't know how I can get accumulate values for this data structure.

 

Can someone kindly help me realize the second and thrid scenarios?

 

Many thanks!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • Hi, Anonymous 

     

    Based on your description, I created data to reproduce your scenario.

     

    You may create a measure as follows and display the result with 'Clustered column chart'. Please check the results without 'Cancel' status.

    Count = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Uniqle ID]),
        'Table'[Order Status]<>"Cancel"
    )

     

    Result:

    s1:

     

    s2:

    s3:

    Best Regards

    Allan

     

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

     

4 Replies

  • I did not get it completely. We can cumulative using date like this

    Cumm distinct count= CALCULATE(distinctcount(Sales[Sales Date]),filter(date,date[date] <=maxx(date,date[date])))

     

  • v-alq-msft's avatar
    v-alq-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

     

    Based on your description, I created data to reproduce your scenario.

     

    You may create a measure as follows and display the result with 'Clustered column chart'. Please check the results without 'Cancel' status.

    Count = 
    CALCULATE(
        DISTINCTCOUNT('Table'[Uniqle ID]),
        'Table'[Order Status]<>"Cancel"
    )

     

    Result:

    s1:

     

    s2:

    s3:

    Best Regards

    Allan

     

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

     

  • v-alq-msft's avatar
    v-alq-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous 

     

    If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

     

    Best Regards

    Allan