Forum Discussion

itsmeanuj's avatar
itsmeanuj
Icon for Helper IV rankHelper IV
6 years ago
Solved

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
  • 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

4 Replies

  • 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

  • nandic's avatar
    nandic
    Icon for Resident Rockstar rankResident Rockstar

    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"}))

    Cheers,

    Nemanja

    • itsmeanuj's avatar
      itsmeanuj
      Icon for Helper IV rankHelper IV

      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. 

      • nandic's avatar
        nandic
        Icon for Resident Rockstar rankResident Rockstar

        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:

         

        Cheers,

        Nemanja