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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Alyona_BI
Helper II
Helper II

Trend Line for bar chart with categorical X-axis

Hi, dear PBI experts! 

 

I need to create the chart in PBI with the following inputs: 

1) This chart should be the combo chart with bars and line. 

2) Bars should be Dates in the format of YearMonths - for example, 2022-Jan, 2022-Feb etc. 

3) Line is trend line based on measure selection. As measures I have 2 metrics: 1) distinct count; 2) simple sum. 

So in the result it should be something like this: 

Alyona_BI_0-1658402521435.png

 

The problem in PBI is that I can't create the trend line for categorical X-axis in easy way. I surfered for the solution at forum, found several similar ones and implemented it: 

https://community.powerbi.com/t5/Desktop/Add-Trend-Line-to-Column-Chart-with-Categorical-X-Axis/m-p/...

 

But unfortunately I didn't recieve the correct trend line. The result is: 

Alyona_BI_1-1658402735396.png

 

Is anyone could help me to deal with this? 

 

The pbix example with data and formulas you could find here: 

https://drive.google.com/drive/folders/1bfnyBf9LTQEJ3C47DpGouF28r9lncRP8?usp=sharing

 

Thanks in advance! 

 

1 REPLY 1
amitchandak
Super User
Super User

@Alyona_BI , You can get a continuous axis with Date and Number, Not with a text column.

 

so YYYYMM can give you a trend not mmm-yyyy

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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