Forum Discussion

tnolte's avatar
tnolte
New Member
7 years ago
Solved

Ordering Yields on a line graph

Somewhat new at PowerBI, but am stuck on creating an order for the following data.  This question has been answer a number of times, but I can't seem to make the solution work though I'm sure it is my lack of experience in PowerBI.

 

The data is a series of yields for specific maturities of specific generic bond curves. For each curve sector name, there will be 15 or 16 different yields.

 

For instance, I wish to display in ascending order the yields for 3m, 6m, 1y, 2y...up to 30y for the Curve Named "USD US Corporate BBB+, BBB, BB".  However, the I cannot seem to order by tenor so the X axis is ascending.   I've done some research here and ran across the solution where I need to create another table with sequential number for each row but, to be honest, I'm a bit lost when reading the solution.

 

Notice how the order goes from 15Y to 30Y then back to 25y then 20y?  All the other tenors are ordered ascending except these 4.

 

 

You'll see that the column "tenors" has non-unique values.  This is because for each curve I wish to plot, they each have similar maturities (i.e., 3 month, 6 month, 10 year, etc...)

 

 

 

2 Replies

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi tnolte,

     

    According to your description, I create sample data to reproduce the scenario. You have the Index Ref column already in your desired sort order from the screenshot, now select the column Tenor and Curve and click Modeling -> Sort by Column as showing picture below.

     

     

     

     

     

     

     

    Then, create Line Chart visual and the Tenor and Curve on the axis will be sorted according to the value of the Index Ref column.

     

     

     

     

     

     

    Here is my test pbix file link: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/ERLX2CJ6RxdEoew9fkFjc9gBlFmcB5mGKpF4P9sBQ4fhVQ?e=5p2MGc

     

    Best Regards,

    Amy

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • tnolte's avatar
      tnolte
      New Member

      This works perfectly.  Thank you.  It appears ordering by the column BEFORE creating the graph is the way to do it.  I had no idea.