Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Display single row value in decimal

Hi,

 

I have a summed column as:

 

FieldValues
A2
B5
C4
D3
E9

 

The real value against Field C is 3.5 and against Field E is 8.9

Can I show the real values in Power BI against these 2 particular fields only? I do Not want remaining values to show up as 2.0, 5.0 and 3.0. Only 4 (Filed C) should show up as 3.5 and 9 (Field E) should show up as 8.9.

  • Anonymous you can put condition and change format based on field, just an idea, you can change as per your need.

     

     

     

    My Field = IF( Table[Field] IN {"C","E"}, FORMAT( [MyValue], "#####0.0" ),
    FORMAT([MyValue],"######"))

5 Replies

  • Anonymous you can put condition and change format based on field, just an idea, you can change as per your need.

     

     

     

    My Field = IF( Table[Field] IN {"C","E"}, FORMAT( [MyValue], "#####0.0" ),
    FORMAT([MyValue],"######"))
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      This worked. Thanks! Just a minor change - 

      My Field = IF( Table[Field] IN {"C","E"}, FORMAT( [MyValue], "#####0.0" ),
      FORMAT([MyValue],"#####0"))

       

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, a follow up question.

       

      I have a table with values to 1 decimal place. Can I have the total with Zero decimal places?

      Please note, this is not a calculated column.

       

      So an addition of

      1.2

      2.5

      5.2

      4.2

      ---

      Total should be 13 and Not 13.1

      • parry2k's avatar
        parry2k
        Icon for Super User rankSuper User

        Anonymous you can check with hasonevalue and change the format of your total.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi parry2k ,

       

      I'm having trouble using your function to work for this exact problem I'm trying to solve. Wondering if you could help.

       

      The name of the data table that I have is called "Region Sales"

       

       

      I want only the "% of Sales" row to show up as a decimal and the other row to remain as a whole number. I can't seem to get your solution to work. Help!

       

      My Field = IF( Table[Field] IN {"C","E"}, FORMAT( [MyValue], "#####0.0" ),
      FORMAT([MyValue],"#####0"))

       

      Thanks!