Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
saksham_kumar
Frequent Visitor

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.

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@saksham_kumar 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],"######"))


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@saksham_kumar 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],"######"))


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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"

 

toyoman62_0-1611770879863.png

 

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!

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

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



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi,

 

This worked. Thanks! Just a minor change - 

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

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.