Reply
Alyona_BI
Helper II
Helper II
Partially syndicated - Outbound

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

Syndicated - Outbound

@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
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)