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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.