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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AR_D
New Member

dynamic x axis

Hi everyone

Below is the snapshot which right now i am getting 

Screenshot 2025-08-05 220308.png

 

When I am selecting "daily" then it's reflecting day wise, but when "Monthly i selected i want to only show month name on x axis not day-wise

In the slicer which i am using for "daily", "Monthly", "30-Day Moving Average so on, i have created a disconnected table then i have used the below dax for this 

Final PULP Trend =
VAR SelectedTrend = SELECTEDVALUE('Trend_Type'[Trend])
RETURN
    SWITCH(
        SelectedTrend,
        "Daily", [total pulp],
        "Monthly",
            CALCULATE(
                [total pulp],
                REMOVEFILTERS(Dim_Date[Date]),
                VALUES(Dim_Date[MonthYear])    
            ),
        "30-Day Moving Average",
            AVERAGEX(
                DATESINPERIOD(Dim_Date[Date], MAX(Dim_Date[Date]), -30, DAY),
                [total pulp]
            ),
        "90-Day Moving Average",
            AVERAGEX(
                DATESINPERIOD(Dim_Date[Date], MAX(Dim_Date[Date]), -90, DAY),
                [total pulp]
            ),
        [total pulp]
    )



Note : My focus is when i select Monthly then on x-axis it should show month name not date for each day.
How to achieve this.

Thanks in advance for the help or the guidence



 

 

1 ACCEPTED SOLUTION

@Ashish_Mathur @FBergamaschi 
Thanku so much for the reponse

I came up with one solution and it working now.
I am using two chart on chart for monthly and second one for the rest of the slicer.
showing chart when monthly selected and hiding it if other are selected.

Just used two measure for this and used visual lever filter.

Once again thank you for the reply.

Chart A Visibility =
VAR _Trend = SELECTEDVALUE('Trend_Type'[Trend])
RETURN
    IF(
        _Trend = "Monthly",
        0,
        1
    )


Chart B Visibility =
VAR _Trend = SELECTEDVALUE('Trend_Type'[Trend])
RETURN
    IF(
        _Trend = "Monthly",
        1,
        0
    )

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FBergamaschi
Solution Sage
Solution Sage

Hi @AR_D 

what is at the moment the role of the slicer you showed ?

 

To answer your question:

The only way to dinamically change the field in the x axis is to create a field parameter and include its column in the x axis of the line chart ajd select his value from the automatically added slicer

 

But I want to understand what you are doing now so I can be sure I really answered you

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

 

 

Thanku you the respose @FBergamaschi 

Let's suppose i want to show total sales ( total sales is on y-axis)
and on x-axis what should i put

so that it work for all the slicer
like if i select daily then it should show daily datewise total sales 
If monthly is selected then It should show total sales by month ( Note: on x-axis should show month name)

Moving average and daily sales is working if on x-axis, i am putting date column
but by focus is when i select monthly then it should show month wise means on x-axis instead of regular date it should show month name.


I confirm you need a field parameter

 

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

 

Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

 

Need help uploading data? click here

 

Want faster answers? click here

@Ashish_Mathur @FBergamaschi 
Thanku so much for the reponse

I came up with one solution and it working now.
I am using two chart on chart for monthly and second one for the rest of the slicer.
showing chart when monthly selected and hiding it if other are selected.

Just used two measure for this and used visual lever filter.

Once again thank you for the reply.

Chart A Visibility =
VAR _Trend = SELECTEDVALUE('Trend_Type'[Trend])
RETURN
    IF(
        _Trend = "Monthly",
        0,
        1
    )


Chart B Visibility =
VAR _Trend = SELECTEDVALUE('Trend_Type'[Trend])
RETURN
    IF(
        _Trend = "Monthly",
        1,
        0
    )

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors