Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Spacing between bars for clustered column chart that used measures only in y axis.

I have a clustered column chart visual that is showing to total awareness for each activity in the marketing channels,
and some of the awarness activities measure calcauted based on more than one measure

when I add all the measures of all activite in the y axis of the  clustered column chart visual i got the bar very close to each other as showing in the screenshot below| as i don't have x axis beacuse i used only measures.

what i want is a way to have some space between each bar or a way to have all the measures of all activity in a table with considering that some of them are a sum of other measure,  so at the end  i can have x axis in the visual.



Her are some of the measures used for this visual:

  • Final_Awareness_Email_Campaings = DISTINCTCOUNT('Automailer_All_JOBID'[TOPEN_GUID])
  • Final_Awareness_Podcast = [Awa_for_Podcasts_from_Automailer]+[Awa_for_Podcasts_from_viva]
    and here we have two measures used for this which are 
    Awa_for_Podcasts_from_Automailer =
    CALCULATE(
        DISTINCTCOUNT('Automailer_All_JOBID'[TOPEN_GUID]),
        FILTER(
            'Automailer_All_JOBID',
            CONTAINS(
                RELATEDTABLE('Automailer_Links_Mapping'),
                'Automailer_Links_Mapping'[Activity],
                "Podcast"
            )
        )
    )
    and 
    Awa_for_Podcasts_from_viva =
    SUMX(
        FILTER('Viva Engage New', 'Viva Engage New'[Activity] = "Podcast"),
        'Viva Engage New'[Total Views]
    )
  • Final_Awareness_Presentation = [Awa_for_Presentation_from_Automailer]+[Awa_For_Presentation_From_Invitees]+[Awa_for_Presentation_from_viva]
  • Final_Awareness_SiteAssets = [Awa_for_SiteAssets_from_Automailer]+[Awa_for_SiteAssets_From_viva]
  • Final_Awareness_Webinar = [Awa_for_Webinar_from_Automailer]+[Awa_for_Webinar_from_viva]
  • Final_Awareness_Website =
    CALCULATE(
        SUM('Adobe_Website_Funnel'[Unique Visitors]),
        CONTAINSSTRING('Adobe_Website_Funnel'[Link Name], "undefined")
    )



  • Hi Anonymous 
    You can't modify the space between the bars, because the graph doesn't have X-axis. it is jest a set of measures that you put there.
    To resolve this issue you can create a measures table and use a dynamic measure to get a bar for every measure.
    For example, in my data, I want to create a graph like yours with Chinese sales and total sales.
    The first step is to create a table of wanted measures :

    Then you can create a dynamic measure using switch

    dynamic measure = SWITCH(SELECTEDVALUE('sales table'[sales type]), "chineese sales",[Chineese_sales],
                                            "total sales",[total_sales])

    After you have a table and a dynamic measure you can use a graph in its natural way :

    the pbix is attached

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    In Power BI, the clustered column chart might not allow you to manually adjust the spacing between individual bars directly. However, you can simulate spacing by adding dummy measures with null or zero values between your actual data measures. This approach requires creating additional calculated measures that return null or a visual representation of zero and placing them between your actual measures in the chart.

     

     

     

     

     

    Best Regards,

    Jayleny

     

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

  • Hi Anonymous 
    You can't modify the space between the bars, because the graph doesn't have X-axis. it is jest a set of measures that you put there.
    To resolve this issue you can create a measures table and use a dynamic measure to get a bar for every measure.
    For example, in my data, I want to create a graph like yours with Chinese sales and total sales.
    The first step is to create a table of wanted measures :

    Then you can create a dynamic measure using switch

    dynamic measure = SWITCH(SELECTEDVALUE('sales table'[sales type]), "chineese sales",[Chineese_sales],
                                            "total sales",[total_sales])

    After you have a table and a dynamic measure you can use a graph in its natural way :

    the pbix is attached

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