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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amalrio
Helper V
Helper V

formatting a measure with a text at the end

Hi Gursu, 

 

I have a measure and I want to add the "M" at the end of it. at the moment output is like 12.0 what what I want to show is

12.0M. 

 

Below is my measure, can any expert modify it to what I want, 

 

any helap is appriciated.

 

===============

Measure  = 

VAR Total = CALCULATE ( SUM ( 'FACT-Data'[NUMARIC] ), 'DIM-Matrics'[MATRIX_ID] = 31 )
VAR Result = IF ( Total = 0, BLANK (), Total ) + 0
RETURN
Result
 
==============
1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @amalrio 

In addition to   's reply, if you add "M" directly, the result will show you 12M not 12.0M. You may try Format function to convert 12 to 12.0 M.

 

 

Measure  = 

VAR Total = CALCULATE ( SUM ( 'FACT-Data'[NUMARIC] ), 'DIM-Matrics'[MATRIX_ID] = 31 )
VAR Result = IF ( Total = 0, BLANK (), Total ) + 0
RETURN
FORMAT(Result,"0.0M")

 

 

Best Regards,

Rico Zhou

 

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

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @amalrio 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

v-rzhou-msft
Community Support
Community Support

Hi @amalrio 

In addition to   's reply, if you add "M" directly, the result will show you 12M not 12.0M. You may try Format function to convert 12 to 12.0 M.

 

 

Measure  = 

VAR Total = CALCULATE ( SUM ( 'FACT-Data'[NUMARIC] ), 'DIM-Matrics'[MATRIX_ID] = 31 )
VAR Result = IF ( Total = 0, BLANK (), Total ) + 0
RETURN
FORMAT(Result,"0.0M")

 

 

Best Regards,

Rico Zhou

 

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

amitchandak
Super User
Super User

@amalrio , You can do like & "M" but till become text after that

 

Measure =
VAR Total = CALCULATE ( SUM ( 'FACT-Data'[NUMARIC] ), 'DIM-Matrics'[MATRIX_ID] = 31 )
VAR Result = IF ( Total = 0, BLANK (), Total ) + 0
RETURN
Result & "M"

 

refer formatting under model view, if that can help

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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