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
mkranitz
Regular Visitor

Comparing count of tickets by month between last year and this year in column chart

Hi guys,

 

I'm still a noob, and have looked through the forums and can't seem to find out how to do something you guys will think is relatively simple!

 

I'm trying to create a graph that shows each month of the year along the x axis. The Y axis will show a count of tickets.

 

I want to know how to create stacked column chart that shows the number of tickets last year vs tickets this year for each month. 

 

I have a single table that I export from an application. The table has two values that I would use for this:

  • Ticket, which is the ticket number
  • Entered, which is the date the ticket was entered

I think I need to create a measure or something that shows all 2018 tickets, and another measure that shows all 2019 tickets and then add them both to the value field of a power bi object, but I haven't been able to crack it!

 

I basically want the following table but instead of $, I want a count of tickets by month for each year.yearcompare.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@mkranitz  Could you show how your data set looks? 

 

If you had ticket numbers as a field and you can add another field called Year and month from the date column you might have .. so it would look like this.. 

 

BarGraph_1.PNG

So you could create a new column in your table and type the DAX as follows:

YEAR = year(Table[Date]) and

MONTH = Month (Table[Date]) to look as the above screenshot

And then you could choose any bargraph type you want in Power BI ( I have just put multiple types for the same data for more visual options!)

 

BarGraph_2.PNG

 

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@mkranitz  Could you show how your data set looks? 

 

If you had ticket numbers as a field and you can add another field called Year and month from the date column you might have .. so it would look like this.. 

 

BarGraph_1.PNG

So you could create a new column in your table and type the DAX as follows:

YEAR = year(Table[Date]) and

MONTH = Month (Table[Date]) to look as the above screenshot

And then you could choose any bargraph type you want in Power BI ( I have just put multiple types for the same data for more visual options!)

 

BarGraph_2.PNG

 

 

 

YES!

Your guidance got me where I needed to go Cat Happy

The stuff I learned while trying to figure out how to do what you suggested was especially helpful!

 

MANY THANKS 🙂

Hi Akshaya,

Thank you for your response - it makes perfect sense.

Following are the relevant fields from the table named "Tickets"

Fields.png

A little wrangling and I think I got it! 🙂 🙂

 

THANK YOU 🙂

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.