Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Column chart count unique by month

(This is the second time I write this message since the forum crashed and my message was lost 😖😭)

 

I'm new to Power BI and am struggling with a column chart that should show unique users per month.

 

I have input from a sql table that looks like this:

 

TimeStamp, UserName

2018-12-28 07:30:12, user1

2019-01-05 07:30:12, user2

2019-01-09 07:30:12, user2

2019-01-21 07:30:12, user3

2019-02-05 07:30:12, user2

2019-02-08 07:30:12, user1

2019-02-20 07:30:12, user2

 

Which I want should generate a column chart with the stacks:

 

2018 dec: 1

2019 jan: 2

2019 feb: 2

 

 

How can I achieve this?

 

Thanks!

  • Hi Anonymous ,

     

    Setup your bar char as following:

    • X-Axis - Table[TimeStamp] (If it's an hierarchy choose Month if not you need to create a month column)
    • Values - Table[UserName] - Select distinct on the aggregation

    Regards,

    MFelix

3 Replies

  • Hi Anonymous ,

     

    Setup your bar char as following:

    • X-Axis - Table[TimeStamp] (If it's an hierarchy choose Month if not you need to create a month column)
    • Values - Table[UserName] - Select distinct on the aggregation

    Regards,

    MFelix

  • Anonymous's avatar
    Anonymous
    Not applicable

    Great, thanks!

     

    My data at the moment is just from 2019. Will this work even when we cross into the new year? I would like it to show which month of which year that was counted? And not just count events per "month name".

    • MFelix's avatar
      MFelix
      Super User
      Hi Anonymous,

      You can do one of two things:
      - Add the year to the x-axis and get an hierarchy of year/month with drill down drill up option
      - Create a column with the format month-year and use it as your x-axis.

      Regards,
      MFelix