Forum Discussion

sawn's avatar
sawn
Frequent Visitor
4 years ago
Solved

Need help with Counting distinct occurrences

Hello, I would like to count the number of occurrences of water points either new or rehabilitated and visualize the numbers separately in charts. How do I go about this? Thank you

 

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    I have almost the same problem and looking for DAX function to be used to solve this.

     

    In my below table, i'd like to count number of occurences of title per month. For example, in June we have 2 title, In August we have 3 etc......

     

    How can i go about this? 

     

    Thank you

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    I'm looking for DAX function to be used to solve this.

     

    In my below table, i'd like to count number of occurences of title per month. For example, in June we have 2 title, In August we have 3 etc......

     

    How can i go about this? 

     

    Thank you

     

     

     

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

    Hi,

    There are multiple ways to do this which all differ based on your specific need.

    Here are some examples:
    Simple measure = count('Water'[Structure])
    Measure with filters: 

    water =
    CALCULATE(COUNTX(filter(filter(Water,Water[Type] in {"New","Rehabilated"}),Water[Structure]="Water point"),Water[Structure]))

    Filter the visual:

     

     

    I hope this helps to solve your issue and if it does consider accepting this as a solution and giving it thumbs up!

     
    • sawn's avatar
      sawn
      Frequent Visitor

      Thanks, I would want my visuals to appear like below

       

      • VahidDM's avatar
        VahidDM
        Icon for Super User rankSuper User

        HI sawn 

         

        Try these measures:

        No. of Rehabilitated Water Points =

        CALCULATE(COUNTA(Water[Structure]),filter(Water,Water[Type]="Rehabilitated"&&Water[Structure]="Water point"))


        No. of New Water Points =

        CALCULATE(COUNTA(Water[Structure]),filter(Water,Water[Type]="New"&&Water[Structure]="Water point"))


        If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
        Appreciate your Kudos!!
        LinkedIn: 
        www.linkedin.com/in/vahid-dm/


         

    • sawn's avatar
      sawn
      Frequent Visitor

      Kindly share the pbix file for this. Thank you