Forum Discussion

Wei2's avatar
Wei2
Icon for Helper I rankHelper I
4 years ago

different decimal places in one Line chart

I have a Line chart with 2 legent values. 

How can I  show one line with 1 decimal place and the one line with 3 decimal places in this chart?  

10 Replies

    • Wei2's avatar
      Wei2
      Icon for Helper I rankHelper I

      but format return text type instead of numeric type. 

      Here is my measure 

       

      Value_new =
      IF(CONTAINS('table1', 'table1'[column1],"A"),FORMAT(FIXED(SUM('table1[column2]),1,True),"#0,0"), FORMAT(FIXED(SUM('table1'[Column2]),3,1),"#0,000"))
       
      I want to show data lable in my line chart.   
    • Wei2's avatar
      Wei2
      Icon for Helper I rankHelper I

      Format returns Text type.  But I use VALUE in FORMAT,  data only show 2 decimals. 

  • v-cazheng-msft's avatar
    v-cazheng-msft
    Icon for Community Support rankCommunity Support

    Hi Wei2,

     

    You may try this solution.

    Here is the sample data.

     

    Create a Calculated column.

    FormatedNumeric =
    IF (
        CONTAINSSTRING ( 'Table'[Product], "A" ),
        ROUND ( 'Table'[Sales], 1 ),
        ROUND ( 'Table'[Sales], 3 )
    )

     

    Create a Measure.

    Total = SUM('Table'[FormatedNumeric])

     

    Then, the result looks like this.

     

    Also, attached the pbix file.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

     

    Best Regards,

    Community Support Team _ Caiyun

    • Wei2's avatar
      Wei2
      Icon for Helper I rankHelper I

      I know what happened.  I need to change the display unit to None and it worked. 

      The default is Auto. 

       

      Thank you for your great help. 

      • v-cazheng-msft's avatar
        v-cazheng-msft
        Icon for Community Support rankCommunity Support

        Hi Wei2,

         

        That’s great! Thanks for your reply!

         

        Could you please help mark the solution by Accept as Solution to help the other members find it more quickly. Thanks in advance!

         

        Best Regards,

        Community Support Team _ Caiyun

  • Thanks.  Does that mean that I cannot do it in measure?  I need to create a new column for it? 

    Also actually I don't need to do any calculation.  The reason I used SUM is that I thought I can use FORMAT or ROUND for it.   The thing is that I just need to show data as it is with different decimal?  May I know what I can do it? 

    My table is like:

    JournalMetric2015201620172018
    Biophysical JournalCitescore6.76.46.36.2
    Biophysical JournalImpact Factor3.9723.6323.6563.495
    • Wei2's avatar
      Wei2
      Icon for Helper I rankHelper I

      Sorry my bad I misunderstood you at the first place. 

      So I tried the IF function by creating a new column.  

      But I got the following error message? 

      Don't know why??

    • Wei2's avatar
      Wei2
      Icon for Helper I rankHelper I

      Sorry again.  I've fixed IF function.  But my numbers still show 2 decimals.