Forum Discussion

AlB's avatar
AlB
Icon for Community Champion rankCommunity Champion
7 years ago

Show all items in X axis

Hi all,

I have a line and clustered column chart with week number in the x axis. I've added new data in the last refresh and, although all the data is shown correctly, the x-axis is now showing only the even numbers. How can I force all of the week numbers to be shown? In the screen capture below, the top one is what is happening and the bottom one what I would want (consider only the x-axis, ignore the different data in both charts).

 

Many thanks

 

 

The bottom one is what i'm after 

16 Replies

  • Why is everything in Power Bi so counterintuitive or hard to get done? The most simple features need a work around in order to make them possible.

    • hagargreif's avatar
      hagargreif
      Icon for Advocate I rankAdvocate I

      Because it's Microsoft. The reason eveyone is still working with their apps is Excel (and maybe Word). All the rest is terrible, but we have no choice

      • AlB's avatar
        AlB
        Icon for Community Champion rankCommunity Champion

        Nolock  Greg_Deckler 

         

        Thanks guys. Going for categorical solves the issue but I have quite a lot of charts like that in the file. It'd be quite time-consuming to go chart by chart changing from continuous to categorical. Any idea on how to do that in a faster, more convenient way?

        Many thanks

         

  • Nolock's avatar
    Nolock
    Icon for Resident Rockstar rankResident Rockstar

    Hi AlB,

     

    I think it is the standard behavior of all charts I've seen in many products. If there are to many values on an axis, only some of them will be displayed to stay well-arranged.

    How to enforce it? Increase the width of your chart, which works for now. But it won't work, wenn you get a new data.

     

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi AlB ,

    Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered to close this topic?

     

    Regards,

    Daniel He

  • Hi! Haven't found any simple solution here so just came up with my own.

    My goal was pretty like author of the thread's but with hours in a day instead of weeks. So I calculated amount of incidents by hours of a day. And it was critical to save hours with zero-values for saving 24h structure of X-axis for user convinience. But filtering particular category gave me zero-value on some hours. And when I chose categorical X-axis it didn't show these hours with zeroes on viz so the 24h structure changed which made user feel acute pain.

    SOLUTION I've found:

    1) create mesuare in original table: 

    IncidentID_DistinctCount = DISTINCTCOUNT('TableOriginal'[IncidentID])

    2) create new table: 

    Table1 = SUMMARIZECOLUMNS('TableOriginal'[Hour of incident])

    It creates new Table1 with single column [Hour of incident], which contains all distinct values in the same column of original table. And since the creation it doesn't react on any filter context for original table.

    3) create link between these two tables by columns [Hour of incident]

    4) take column 'Table1'[Hour of incident] as X-axis

    5) take measure IncidentID_DistinctCount from original table as values

    Profit!