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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
CarsonLoi
Regular Visitor

How to format the dynamic xAxis created by parameter field

I used Fields Parameter to create the dynamic xAxis representing daily / weekly / monthly interval of a bar chart.

However, I can not figure out how to change the format of the xAxis when selecting different interval (daily / weekly / monthly)

 

Current xAxis format is all shown at YYYY MMM format

 

What I would like to archieve is:

daily / weekly xAxis format:  YYYY-MM-DD

monthly xAxis format: YYYY MMM

 

PowerBI.pngPowerBI2.png

 

2 REPLIES 2
Anonymous
Not applicable

Hi @CarsonLoi ,

I create a new table.

DateTable = 
ADDCOLUMNS (
    CALENDAR (DATE(2024, 1, 1), DATE(2024, 2, 29)),
    "Year", YEAR([Date]),
    "Month", FORMAT([Date], "YYYY MMM"),
    "Week", FORMAT([Date], "YYYY-MM-DD"),
    "Day", FORMAT([Date], "YYYY-MM-DD")
)

vyilongmsft_0-1721890728387.png

Then I create a parameter.

DateParameter = 
{
    ("Daily", NAMEOF('DateTable'[Day]), 0),
    ("Weekly", NAMEOF('DateTable'[Week]), 1),
    ("Monthly", NAMEOF('DateTable'[Month]), 2)
}

vyilongmsft_1-1721891041415.png

Then you can see what you want.

vyilongmsft_2-1721891274310.png

vyilongmsft_3-1721891316856.png

If you want to learn more, you can read this document: Dynamically Display X and Y Axis Data in Power BI (mssqltips.com)

 

 

 

Best Regards

Yilong Zhou

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

Hi mate, thanks for the reply!

There's 1 more thing I would like to have your instruction, 

According to the table you have created, the month format is yyyy mmm (e.g. 2024 Jan),

the xAxis format of the monthly interval is simply mmm (e.g. Jan), which seems not aligned with the table format at yyyy mmm.

Therefore, I wonder how the xAxis format the date and can we control / customize the format ?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.