Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Can you hide elements of the X-axis based on certain criteria?

Hi, I wish I could hide the elements of the X-axis where the line is constant or where there are no columns, this way I can only see the points where there are really changes. The columns and points are represented by measurements, while the X-axis is represented by a column of a table. Is there a way to achieve this?

Jaumedomi_0-1741940270477.png

1 ACCEPTED SOLUTION
freginier
Solution Sage
Solution Sage

Hey there!

 

Power BI does not provide a direct way to conditionally hide X-axis elements, but you can achieve a similar effect using filters and calculated columns/measures.

If you want to show only points where there are real changes and hide constant values, create a DAX measure that filters out unchanged values:

ShowPoint =
VAR CurrentValue = SELECTEDVALUE(YourTable[Measurement])
VAR PreviousValue =
CALCULATE(
MAX(YourTable[Measurement]),
FILTER(YourTable, YourTable[Date] < MAX(YourTable[Date]))
)
RETURN
IF(CurrentValue <> PreviousValue, 1, BLANK())

1. Apply this measure as a filter in your visual.

2. Set "Show items when value is not blank".

 

If you want to hide X-axis labels when values are constant:

  1. Go to X-Axis settings in Format pane.
  2. Use a conditional formatting rule for labels:
    • Create a new column:

HideLabel = IF(YourTable[Value] = PreviousValue, BLANK(), YourTable[Date])

Set X-axis labels to use HideLabel instead of the full dataset.

 

Hope this helps!

😁😁

 

 

View solution in original post

4 REPLIES 4
v-pnaroju-msft
Community Support
Community Support

Hi Syndicate_Admin,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi Syndicate_Admin,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thank you, @freginier,for your response.

 

Hi Syndicate_Admin,

 

We would like to check if the solution provided by @freginier has resolved your issue. If you have found an alternative approach, we encourage you to share it with the community to assist others facing similar challenges.

If you found the response helpful, please mark it as the accepted solution and add kudos. This recognition benefits other members seeking solutions to similar queries.

 

Thank you.

freginier
Solution Sage
Solution Sage

Hey there!

 

Power BI does not provide a direct way to conditionally hide X-axis elements, but you can achieve a similar effect using filters and calculated columns/measures.

If you want to show only points where there are real changes and hide constant values, create a DAX measure that filters out unchanged values:

ShowPoint =
VAR CurrentValue = SELECTEDVALUE(YourTable[Measurement])
VAR PreviousValue =
CALCULATE(
MAX(YourTable[Measurement]),
FILTER(YourTable, YourTable[Date] < MAX(YourTable[Date]))
)
RETURN
IF(CurrentValue <> PreviousValue, 1, BLANK())

1. Apply this measure as a filter in your visual.

2. Set "Show items when value is not blank".

 

If you want to hide X-axis labels when values are constant:

  1. Go to X-Axis settings in Format pane.
  2. Use a conditional formatting rule for labels:
    • Create a new column:

HideLabel = IF(YourTable[Value] = PreviousValue, BLANK(), YourTable[Date])

Set X-axis labels to use HideLabel instead of the full dataset.

 

Hope this helps!

😁😁

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.