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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
stribor45
Post Prodigy
Post Prodigy

Chart for Selected month count and same period last year

I was wondering if anyone had suggestions on how to best present the data for selected months and the period last year months.

My data goes from last year July until now and since some months don't have data yet in the table there is nothing and in the chart they show equal values. Look for example the November? any recommendations on how to show this data?

 

Thank you

 

stribor45_0-1694903296206.png

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@stribor45 Well when you are working on date and time, you need to have a seperate dimension for time not as part of the calendar dimension. Search on google about time dimension and you will get the solution. 

 

Basically, the calendar dimension is only the date data, the time dimension is only the time data and data table where the date and time will be in two different columns. This is the right approach and the best practice.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

14 REPLIES 14
parry2k
Super User
Super User

@stribor45 Well when you are working on date and time, you need to have a seperate dimension for time not as part of the calendar dimension. Search on google about time dimension and you will get the solution. 

 

Basically, the calendar dimension is only the date data, the time dimension is only the time data and data table where the date and time will be in two different columns. This is the right approach and the best practice.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k I will try that and let you know

parry2k
Super User
Super User

@stribor45 then it is not a calendar table, calendar time needs to have a unique date, you need to remove the time element from it and then use it. 

 

Check the related videos on my YT channel

 

Add Date Dimension
Importance of Date Dimension
Time Intelligence Playlist

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I think it worked (see below). I do have a couple of questions

 

  1.  Is there a way to adjust the tooltip to show different text?  If you mouse over the August 2023 bar and the bar right next to it for the August 2022 only difference is the count but both will show August 2023 (Year Month) is always the same
  2. Is there a way to show these in order? as of now August is shown before July and should be other way around.
  3. Is there a way to show something when there is no data for previous or current month. As an example as of now i have no data for October 23 but I do have data for Octover 2022. Is this the best way to show if there is no data there is no bar?

Thank you 

 

 

 

 

 

stribor45_0-1694998919794.png

stribor45_1-1694999002048.png

stribor45_2-1694999121468.png

 

@stribor45 

 

1 - not as such but you can look at the report tooltip (aka custom tooltip)

2 - this is a sorting issue, you should look into sort by to sort your month/year column.

3 - totally your call what you want, I would recommend not to show previous year data if current year data is not available. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k this is what my datetime column in table #1 and table #2 looks like.. If I remove the time portion from the calendar table how wouldn't that break the relationship? Removing the time portion from Calendar and Table #1 will also not allow me to be able to count calls based on the time of the day (morning, afternoon and evening). As of right now this seems to work when presented in table visual but not in chart visul

 

stribor45_0-1694951608650.png

 

parry2k
Super User
Super User

yes sir



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

This is my Calendar table (it goes up in time by 1 min). When I try to mark it as a date table this is what i see

 

stribor45_0-1694915450971.png

 

stribor45_2-1694915492882.png

 

parry2k
Super User
Super User

@stribor45 I see the mistake, you need update your measure and also make sure your date table is marked as date table:

 

TOTAL PREV PERIOD = CALCULATE([TOTAL COUNT], SAMEPERIODLASTYEAR('Calendar'[Dates]))


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

You mean mark my Calendar table as date table?

parry2k
Super User
Super User

Share your measure expression? Do you have date dimension in your model?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I do have a calendar/date table which has a relationship with Table #1 and Table #2

 

TOTAL COUNT = COUNT ('Table #1'[Caller ID]) + COUNT('Table #2'[Caller ID])
TOTAL PREV PERIOD = CALCULATE([TOTAL COUNT], SAMEPERIODLASTYEAR('Calendar'[Dates].[Date]))

 

parry2k
Super User
Super User

@stribor45 you shouldn't be showing only the month name on the x-axis because you cannot tell which month of which year you are comparing, for now probably it doesn't matter but once you have 3-4 years this will be hard to read.

 

You should have a column with Year/Month concatenated and use that on the x-axis then you will not have this issue.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I tried that but didn't work.  July, August and September should have data for this year and for the past

 

stribor45_0-1694909715248.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.