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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
itsmeanuj
Helper IV
Helper IV

one value on secondary axis

Hi, I have sales of 3 products as shown below in the table. I want to create a line chart in PBI, however, sales of Product C is so high which shows the sales of the other 2 product almost 0 on the line chart which is not true. Is it possible to show product C on the secondary axis and remaining products on the primary axis keeping the legends intact?  

 

ProductMonthSales
A1-Jan100
B1-Jan90
C1-Jan10000
A1-Feb110
B1-Feb105
C1-Feb11000
A1-Mar120
B1-Mar110
C1-Mar14000
A1-Apr130
B1-Apr95
C1-Apr18000
A1-May125
B1-May130
C1-May17000
A1-Jun110
B1-Jun115
C1-Jun16000
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@itsmeanuj , if you plan to use the legend, it will show all one axis. You can create a measure filter with product C and use that on secondary axis

View solution in original post

4 REPLIES 4
nandic
Memorable Member
Memorable Member

Hi @itsmeanuj ,

 

As @amitchandak  mentioned, in order to use one measure as column, second measure as line, it will display in legend these two measures. You can always play with measure names if needed 🙂

Sales Product C = CALCULATE(SUM(Sheet1[Sales]),FILTER(Sheet1,Sheet1[Product]="C"))
Sales Products AB = CALCULATE(SUM(Sheet1[Sales]),FILTER(Sheet1,Sheet1[Product] in {"A","B"}))

Secondary axis.PNG

Cheers,

Nemanja

@nandic @amitchandak  - With this approach, I will not be able to show individual products in legend. My data has 10 products out of which one product's sales are way too high to put it on a similar axis with other products. I want to show all the products in legend and product with very high sales on the secondary axis. 

Hi @itsmeanuj ,

There must be better solution, but here is some kind of alternative.

You create 2 new columns in fact table: one returns sales amount only if product <> product C, second column returns sales amount only if product = product C. (if product C has much higer value comparing to other products)

You create 2 charts - one displays first column, second displays second column (this way you get all products on both charts, but chart columns are displayed only if sales amount > 0).

You need to configure some options on second chart (background transparent 100 %, remove title, axis x title, set y axis right).

Last step is to set second chart over first chart.

Note: this way you will not be able to click on both charts to filter other objects on the report, only on the one which is on top.

Screenshots:

 

double axis 1.PNGdouble axis 2.PNG

Cheers,

Nemanja

amitchandak
Super User
Super User

@itsmeanuj , if you plan to use the legend, it will show all one axis. You can create a measure filter with product C and use that on secondary axis

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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