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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
afaque03
Helper I
Helper I

Need to restrict x-axis data

Hi 

 

I am stucked in an issue in which I just want to display the x-axis in my line chart and I dont want to display the values.

 

x-axis.JPG

 

This data gets populated when i select the value 3 in my slicer I want just to see the line getting drawn for x-axis value of 21,22,23

for rest i just want to see in x-axis but dont want to see the line drwan for it. In the x-axis the hours is getting displayed which shows the value of incoming data for each hour. As I dont want to see any incooming data for 00,01,02,03,04,05 hours just want to see it in x-axis dont want to see the value of it. How can i restrict the chart to draw line for just 21,22,23.

 

Tried visual filter but using that the x-axis 00,01,02,03,04 does not get displayed in the x-axis. As I want those in x-axis but line should not be displayed in top of it.

For e.g something like this -:

 

to be.JPG

 

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @afaque03

i'm afraid there is no direct function to show as you expected.

However, as i tested, i can work out it with a workaround.

 

 

I can get the value of 21,22,23 when i select the value 3 in my slicer

Measure1 =
IF (
    MAX ( Table1[slicer] ) = 3,
    IF (
        MAX ( [hours] ) = 21,
        CALCULATE ( MAX ( [value] ) ),
        IF (
            MAX ( [hours] ) = 22,
            CALCULATE ( MAX ( [value] ) ),
            IF ( MAX ( [hours] ) = 23CALCULATE ( MAX ( [value] ) )BLANK () )
        )
    )
)

 

Then add the measure to Value Field, please note that make the "show items with no data" checked

 

72.png

71.png

 

 

Best Regards

Maggie 

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @afaque03

i'm afraid there is no direct function to show as you expected.

However, as i tested, i can work out it with a workaround.

 

 

I can get the value of 21,22,23 when i select the value 3 in my slicer

Measure1 =
IF (
    MAX ( Table1[slicer] ) = 3,
    IF (
        MAX ( [hours] ) = 21,
        CALCULATE ( MAX ( [value] ) ),
        IF (
            MAX ( [hours] ) = 22,
            CALCULATE ( MAX ( [value] ) ),
            IF ( MAX ( [hours] ) = 23CALCULATE ( MAX ( [value] ) )BLANK () )
        )
    )
)

 

Then add the measure to Value Field, please note that make the "show items with no data" checked

 

72.png

71.png

 

 

Best Regards

Maggie 

@v-juanli-msftThnx for the solutions but one issue is there If i click on slicer and select some other value it gives me blank. Can you help me with this please.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.