Forum Discussion

ExcelMonke's avatar
ExcelMonke
Icon for Impactful Individual rankImpactful Individual
2 years ago

Show All Categories on X Axis

Hello, 
I am currently building two bar charts and I need some help with X-Axis formatting. 

The problem:

In Chart 1) I am looking at a sub-group's performance, their "time buckets" only go up to 60 minutes.

In Chart 2) I am looking at the parent group performance, their "time buckets" go up to 240 minutes.

 

The desired solution: 
I want the X axis for both charts to be the same, to go up to 240 minutes. This means that Chart 1) will show the time bucket on the x axis, even if the value is 0.

 

Example Data:

 

VisitGroupSub-GroupTime Bucket
1AAb10
2AAb10
3AAb20
4AAb30
5AAb60
6AAc10
7AAc15
8AAc20
9AAc20
10AAc20
11AAc60
12AAc60
13AAc240
14AAc240

 

Desired Result:

Notice how the X-Axis in Chart 1 - which charts sub-group Ab - still show buckets 15 and 240, even if the value is 0

 

Thank you!

7 Replies

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

    ExcelMonke 

     

    im not sure. 

    maybe you enable the show items with no data. 

     

    if not, maybe sharing the file if possible so i can take a closer look . 

     

     

    best regards,

    • ExcelMonke's avatar
      ExcelMonke
      Icon for Impactful Individual rankImpactful Individual

      Thanks, that is how I got it to work on Excel, but I have not been able to find a similar button/option on Power BI. Any help finding it is also appreciated 🙂 

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

        ExcelMonke 

         

        you just need to right click on the column name. ( or click on the arrow down ) 

         

         

        hope this helps . 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ExcelMonke ,

    Please follow these steps:

    According to your description, I created the following metric for the subgroup "Ab", and by the last judgment, the count result of 0 can also be displayed in the chart.

     

    Measure =
    
    VAR _count = CALCULATE(COUNT('Table'[Time Bucket]),FILTER(ALL('Table'),'Table'[Sub-Group] = "Ab" && 'Table'[Time Bucket] = MAX('Table'[Time Bucket])))
    
    RETURN
    
    IF(_count = 0,0,_count)

     

    The final result is shown below.

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • ExcelMonke's avatar
      ExcelMonke
      Icon for Impactful Individual rankImpactful Individual

      Thanks for the reply! So i tried to simplify the dataset in the problem. In actuality, the "Group" column comes from a different table (LocationDimension), and is linked to the visit table through the SubGroup name. How would I update the measure accordingly? Also it seems like I can't put the measure in the Axis.