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
Anonymous
Not applicable

converting decimal values to Int for few cells in a measure

Hi,

 

I created a calculated measure "YTD" considering "Application_value" column and created a table visual.

The table visual contains Application names and the created measure "YTD". The created mesure is displaying values in decimals (XXX.00) format.

But, different applications names have different valuetypes such as $, %, ratio. So i need to display the values accordingly for "YTD".

I tried writing an IF statement in the filter for YTD measure, but i am not able to convert the decimals to any other datatypes. is there a way to do it?

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

The file seems gone. Please refer to a demo below. Please also refer to the custom formats.

Demo =
VAR TotalActualValue =
    COUNT ( 'Table1'[Column1] )
RETURN
    IF (
        MIN ( 'Table1'[Column1] ) = "a",
        FORMAT ( TotalActualValue, "$#,##0.00" ),
        FORMAT ( TotalActualValue, "0.00%" )
    )

converting-decimal-values-to-Int-for-few-cells-in-a-measure

 

Best Regards,
Dale

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

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@Anonymous you have to use format function with if condition to get respective format.



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

 
I tried adding the filter as below:
FILTER('tablename', if('tablename'[Application_name]="abc",FORMAT([Total Actual Value], INT([Total Actual Value])),[[Total Actual Value]]))). But i see no change. 
 
Correct me if i am wrong.
 
Thanks,
Keerthi

@Anonymous is it possible for you to share pbix file with sample data? Remove sensitive information before sending it over.



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

I dont see any attachements icon to send the Pbix file. ANy other way?

 

you can share thru onedrive/googledrive/dropbox etc



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

@parry2k let me know if you can access the file

Hi @Anonymous,

 

The file seems gone. Please refer to a demo below. Please also refer to the custom formats.

Demo =
VAR TotalActualValue =
    COUNT ( 'Table1'[Column1] )
RETURN
    IF (
        MIN ( 'Table1'[Column1] ) = "a",
        FORMAT ( TotalActualValue, "$#,##0.00" ),
        FORMAT ( TotalActualValue, "0.00%" )
    )

converting-decimal-values-to-Int-for-few-cells-in-a-measure

 

Best Regards,
Dale

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

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.