Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Show customer data for selected months

Hi Team

 

I have a table with customer name, Month like 2018 07-Jul,Order id. Suppose I select Months as May, June and July(in the mentioned format 2018 07-Jul), I only want to show those customer name who have a order for all the selected months. Suppose customer Alex has order id's for May,June and July then show Alex and John has order in June and July then don't show John.

 

 

4 Replies

  • Stachu's avatar
    Stachu
    Icon for Community Champion rankCommunity Champion

    try putting this measure in the visual filter while filtering to TRUE

    Measure = 
    VAR SelectedPeriods =
        ALLSELECTED ( 'Table'[Month] )
    VAR PeriodsPerCustomer =
        SUMMARIZE ( 'Table', 'Table'[Month], 'Table'[Customer] )
    RETURN
        IF (
            COUNTROWS ( SelectedPeriods ) = COUNTX (PeriodsPerCustomer, [Month] ),
            TRUE,
            FALSE
        )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Stachu GilbertQ

       

      I have used the DAX you mentioned as a measure instead of TRUE(), I have CALCULATE(COUNT(column),ALLSELECTED(MONTH)) so its working fine for selected 3 Months but its not showing the breakdown for the users for the 3 selected months.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Stachu GilbertQ 

     

    If I select 1 month can we show only thoe customers who have sales in the last 3 months. Suppose if I select Aug it should show customers who have made sales in June,July and Aug.

    • GilbertQ's avatar
      GilbertQ
      Icon for Super User rankSuper User
      Hi there,

      This could possibly be done. The challenge is understanding what is selected and to then go back 3 months based on what month you have selected.

      Do you has some sample data and the expected result?