Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mottosson
Regular Visitor

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!

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @mottosson ,

 

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


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
mottosson
Regular Visitor

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".

Hi @mottosson,

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

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



MFelix
Super User
Super User

Hi @mottosson ,

 

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


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.