Forum Discussion

Shannon-COTR's avatar
Shannon-COTR
Regular Visitor
3 years ago

Remove Gaps When Comparing Year over Year

I'm trying to create a line graph that compares our weekly (Sunday) attendance year-over-year. My raw data contains unique dates for each Sunday from 2019-2023 as well as a caculated week number. Power BI has also automatically broken the date data down into years, quarters, months and days.

 

When I create the line graph with just the week numbers along the x-axis, it works perfectly. If I add the months in to make it a little easier for my staff to identify what they're looking at (most people don't know off the bat what time of year week 32 falls into), there are then large gaps anytime a week falls into a different month (e.g. week 5 is sometimes the last week of January and other times the first week of February, depending on the year).

Is there a way to have the line chart continuous so that it's easier to see the trends, but still be able to show the months?


Here's a screenshot with the months included in the x-axis and the resulting gaps:

 

 

Here's a screenshot with just the weeks; the line graph is much easier to read except that it's far more difficult for my staff to be able to tell what time of year they're looking at:

 

3 Replies

  • Shannon-COTR whatever measure you are using on values just add zero to it.

     

    Measure = COUNTROWS ( Table ) + 0

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @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! ❤️

    • Shannon-COTR's avatar
      Shannon-COTR
      Regular Visitor

      Thanks, but I'm not using any calculated measures at all so I don't think that this would work.

  • Shannon-COTR then you should create a measure that you want to use on values and as suggested add +0 to it.

     

    👉 Learn Power BI and Fabric - subscribe to our YT channel - @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! ❤️