Forum Discussion

akhaliq7's avatar
akhaliq7
Post Prodigy
1 year ago
Solved

Reduce Month-Year values in Line Graph (x-axis)

I have a line graph with the month-year on the x-axis. As the chart is relatively small, I need help reducing the number of month-years, showing a gap of two months instead of one. I want to show Jan-24, Mar-24, May-24, etc. How can I do this? I did have a look at bins but as it is a text column only allows me to use lists.

  • Hi akhaliq7 ,

    Option 1: Create a Calculated Column for Alternating Months

    Create a Calculated Column:

    • If your Month-Year field is a date column, you can use the following DAX formula to create a new calculated column that only includes every second month (e.g., odd months: Jan, Mar, May, etc.):
      AlternateMonths = IF( MOD(MONTH([YourDateField]), 2) = 1, FORMAT([YourDateField], "MMM-yy"), BLANK())

       

    Option 2: Manually Adjust X-Axis Labels (Visual-Level Filter)

    If you prefer to avoid creating a new column, you can apply a filter directly to the visual:

    Visual-Level Filter:

    • In the visual’s Filters pane, add your Month-Year field.
    • Manually select only the months you want to display (e.g., Jan-24, Mar-24, May-24, etc.).
      This method works but requires manual maintenance if the data gets updated.

    I hope this is helpful.
    Thank You

1 Reply

  • Hi akhaliq7 ,

    Option 1: Create a Calculated Column for Alternating Months

    Create a Calculated Column:

    • If your Month-Year field is a date column, you can use the following DAX formula to create a new calculated column that only includes every second month (e.g., odd months: Jan, Mar, May, etc.):
      AlternateMonths = IF( MOD(MONTH([YourDateField]), 2) = 1, FORMAT([YourDateField], "MMM-yy"), BLANK())

       

    Option 2: Manually Adjust X-Axis Labels (Visual-Level Filter)

    If you prefer to avoid creating a new column, you can apply a filter directly to the visual:

    Visual-Level Filter:

    • In the visual’s Filters pane, add your Month-Year field.
    • Manually select only the months you want to display (e.g., Jan-24, Mar-24, May-24, etc.).
      This method works but requires manual maintenance if the data gets updated.

    I hope this is helpful.
    Thank You