Forum Discussion

LaelTejo's avatar
LaelTejo
Frequent Visitor
2 years ago
Solved

Graph Visualization X-Axis Category Name and Conditional for Maximum Range

Hello!

 

I have some issues with a certain graph visualization, and hope to be able to get help on it.

 

I have the following graph for the Amount of Deployed Projects per month:

 

It willl have most months empty, because it is still March right now.

 

The structure of the graph is as follows:

1. Y-Axis = Distinct Count of Deployed Projects (DAX)

2. X-Axis = Deployment Date in Date format. Set to be Hierarchy, and removed the year, quarter, and day. This has a relations with a full year calendar.

 

I think this graph is workable enough, but I have some ideas to make the graph easier to understand (diagonal month make it rather hard to see which month is the bar represents), and I have tried several methods.

 

I would be happy if someone can tell me to do the following:

1. Change the Month Hierarchy into an "MMM" format. I tried using the method from here: Solved: Show short month names on axis - Microsoft Fabric Community, but it ended up like this:

and I cannot find the way to "Show items with no data" for it, and I cannot find a way to do this. Please tell me if there is a way to do this while still showing months with 0 data (up to Dec). If there are simply no way for this, can you recommend a way to make it clearer?

 

2. I put in the Maximum number for the graph to be 100 because the default Auto for it makes the bar too high. But we have more than 500 ongoing enhancements already, and the graph will soon be overrun and need to be re-published. How do I make it so that the Maximum Range would be the Max # of Deployed + n, where n= 20% of all enhancement?

 

I understand the questions are rather simple and are more nice-to-have rather than a mandatory, but I am myself unable to make it work. I would be very happy should any help can come my way. I hope my explanation is sufficient.

 

Thank you.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, LaelTejo 

     

    To display items that don't have data, make sure that this new column is relevant to the calendar table for the whole year. This relationship will fill a gap where there has been no data for months. For more details about date hierarchies and working with date formats, you can review the following documents:

     

    Auto date/time in Power BI Desktop - Power BI | Microsoft Learn

     

    To dynamically adjust the maximum range of a graph, you can use a measure to calculate this value dynamically.
    Create a new measure to dynamically calculate the maximum value. For example:
    Max Range = MAX('Table'[Deployed Projects]) + (0.2 * COUNT('Table'[Enhancements]))


    Power BI doesn't allow you to bind axis scales directly to measures. As a workaround, you can use this measure in a KPI or card visual to track the maximum value that should be set manually. While not ideal, this method allows you to monitor when you need to adjust the maximum value of the Y axis of the graph.

     

    How to Get Your Question Answered Quickly 

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

    Best Regards

    Yongkang Hua

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, LaelTejo 

     

    To display items that don't have data, make sure that this new column is relevant to the calendar table for the whole year. This relationship will fill a gap where there has been no data for months. For more details about date hierarchies and working with date formats, you can review the following documents:

     

    Auto date/time in Power BI Desktop - Power BI | Microsoft Learn

     

    To dynamically adjust the maximum range of a graph, you can use a measure to calculate this value dynamically.
    Create a new measure to dynamically calculate the maximum value. For example:
    Max Range = MAX('Table'[Deployed Projects]) + (0.2 * COUNT('Table'[Enhancements]))


    Power BI doesn't allow you to bind axis scales directly to measures. As a workaround, you can use this measure in a KPI or card visual to track the maximum value that should be set manually. While not ideal, this method allows you to monitor when you need to adjust the maximum value of the Y axis of the graph.

     

    How to Get Your Question Answered Quickly 

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

    Best Regards

    Yongkang Hua

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