Forum Discussion

jahidfazal's avatar
jahidfazal
Regular Visitor
3 years ago

How to get count for user data

Source.Name      user     status
2023-01-02.csv    xyz       OOO
2023-01-02.csv    abc       WFH
2023-01-02.csv    pqr       OOO
2023-01-03.csv    xyz        HYD-RHJ
2023-01-03.csv    abc        BLR
2023-01-03.csv    pqr        GGM
2023-01-04.csv    xyz         HYD-RHJ
2023-01-04.csv    abc         BLR
2023-01-04.csv    pqr         WFH
2023-01-05.csv    xyz         HYD-RHJ
2023-01-05.csv    abc         WFH
2023-01-05.csv    pqr          OOO
How can we get the count of status for each user mentioned in column user

I need following output
user   StatusCount
xyz        3
abc       2
pqr       1


How can we achive this using power BI? Any idea please suggest

2 Replies

  • Hello jahidfazal ,

     

    use this measure

    StatusCount = DISTINCTCOUNT('Table'[Status])
     
    you just change the "table" to the table's real name.
    the visualise it along with the user field in a table.
     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

     

    Follow me on Linkedin

    • jahidfazal's avatar
      jahidfazal
      Regular Visitor

      Hi @Idrissshatila Thank you for your response.

      I used your solution but it is not working as expected 

      jahidOOO
      jahidHYD-RHJ
      jahidHYD-ILABS
      jahidWFH
      jahidWFH

       

      For able table I am expecting output as 2 be getting as 3. Please let me know if I am missing something.
      We have a column statuses which has values like HYD-RHJ, HYD-ILABS, GGM, BLR which needs to be considered for count any other value must not be considered. Also, one user might be in any of statuses (HYD-RHJ, HYD-ILABS, GGM, BLR), so here we will be count if a user is in any of the above statuses.