Forum Discussion

prashantg364's avatar
prashantg364
Icon for Helper II rankHelper II
2 years ago

line charts

I have a data table as shown below.

I wish to create a multiple-line chart where I want to display codes A & B Sales on the primary axis and code C Sales on the secondary axis.

datecodeSales
01-JanA50
01-JanB55
01-JanC60
15-JanA40
15-JanB75
15-JanC70
30-JanA40
30-JanB50
30-JanC60
01-FebA70
01-FebB60
01-FebC50
15-FebA45
15-FebB35
15-FebC20
28-FebA25
28-FebB50
28-FebC30

 

I am able to create the same in MS excel but seems facing issues in power BI.

 

2 Replies

  • Uzi2019's avatar
    Uzi2019
    Icon for Community Champion rankCommunity Champion

    Hi prashantg364 
    What issue you are facing in power bi ?? you didnt mentioned that.

     

    share screenshot what is you query?

     

    for Y axis you can take value from other  column it seems you all A B C values are coming under 1 column so that why power bi takes all you A B C values on Y axis not on secondary Y axis.

     

    You can create a measure like this for Secondary Y axis
    Column c= CALCULATE ( Sum( Sales), [Code]= "C")

    It will create a seperate measure for your C code. take your measure into secondary Y axis.

     

    For Y axis create another measure with consist of 2 code A &B
    Column A&B= CALCULATE ( Sum( Sales), AND([Code]= "A",[Code]= "B")

     

    Take column A&B in Y axis 
    Take column C in secondary Y axis.

    I hope I answered your question!

     

     

  • Shivu-2000's avatar
    Shivu-2000
    Icon for Responsive Resident rankResponsive Resident

    Hey prashantg364 
    You can simply create two columns 
    1. For code - A&B 
    2. Foe code - C
    and now you can simply create the multiple-line chart where you can display codes A & B Sales on the primary axis and code C Sales on the secondary axis.
    To create the column use the following: https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-calculated-columns

    I hope my answer was helpful to you!

     

     

    Don't forget to give thumbs up and accept this as a solution if it helped you!!!