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
Anonymous
Not applicable

X-Axis to show two data columns like Excel

Hello all, I have just started using PBi. I have a chart in Excel which shows two data values, the month and the population, it looks like this:

 

image.png

 

The way I acheive this is simply expanding the data selection for x-axis to include both, month and population columns, which are adjecent to each other. Is there any way I can do the same in PBi?

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

You could try to add two field in chart like below and create month date column by M code , then you could set sort by month date column.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krM0zW0VNJR0sizNTS11ASyDPRMzZRidaKV3FKTkOQsoHIWYDnfxCKEnJkxVM4cLOdYgCRnAtNnBNVXiWSmKVTOECznVYrkFjMDqJwxVC4HSQ6mTyk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Month = _t, Population = _t, Rate = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{ {"Population", type text}, {"Rate", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Month date", each "01-"&[Month]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Month date", type date}})
in
    #"Changed Type1"

622.PNG623.PNG

 Or you also could create a calculated column like below , then set sort by like above image

624.PNG

Best Regards,
Zoe Zhi

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

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hello all,

I apologize I was not very clear in the original post. I hope the below explanation helps:

 

I would like to make a PBi run-chart providing information on the following three columns:

1.png

Where the “Month” and “Population” would be shown on X-Axis (horizontal), as shown in the below diagram:

2.png

The way I achieve this in Excel is I select both, Month and Population, columns in the “Horizontal (Category) Axis Labels”, as shown below:

3.png4.png

My question is, is this something that can be done in PBi? I don’t really want to plot the (n=__) values on a secondary axis.

I hope this makes is a little more clear what I am after.

 

I appreciate your previous responses!

Thank you,

Drcvg4.

 

dax
Community Support
Community Support

Hi @Anonymous , 

You could try to add two field in chart like below and create month date column by M code , then you could set sort by month date column.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8krM0zW0VNJR0sizNTS11ASyDPRMzZRidaKV3FKTkOQsoHIWYDnfxCKEnJkxVM4cLOdYgCRnAtNnBNVXiWSmKVTOECznVYrkFjMDqJwxVC4HSQ6mTyk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Month = _t, Population = _t, Rate = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{ {"Population", type text}, {"Rate", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Month date", each "01-"&[Month]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Month date", type date}})
in
    #"Changed Type1"

622.PNG623.PNG

 Or you also could create a calculated column like below , then set sort by like above image

624.PNG

Best Regards,
Zoe Zhi

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

 

dax
Community Support
Community Support

Hi @Anonymous ,

I am not clear about your requirement,  did you want to show two columns in the same axis? If so , I think you could try to create a calculated column to combine two column into the same column. If you want to show it in two rows, you could try to use Matrix to achieve this goal. So if possible could you please inform me more detailed information(such as your expected output and your sample data)? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

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

 

Anonymous
Not applicable

Thank you for your response. I have replied to the original thread with a more detailed explanation to make it more clear.

 

Greg_Deckler
Community Champion
Community Champion

You can create a custom, adhoc hierarchy for an x-axis in Power BI and then use drilldown with concantenated labels. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

Not very clear.

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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