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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Dynamic Formatting for Thousands & Millions

Hi all,

 

I wonder if anyone can suggest a means of using the custom format capabilities of PowerBI to replicate what in Excel would look like this:

 

[>=1000000] #,##0.00,,"m";[<1000000] #,##0.0,"k";General

 

Essentially what I'm after is for when the number is in the millions for it to be formatted with two decimal places and have an 'm' appended to the number, when it's in the thousands, a single decimal place and a 'k' appended. I'm aware that I could create a measure using the SWITCH function to do this, but wonder if anyone has come up with a custom format that does the same thing?

 

Thanks in advance,

 

SamB

9 REPLIES 9
TrevLc
Helper III
Helper III

Power BI can now do this. It is called dynamic format strings

Create dynamic format strings for measures in Power BI Desktop - Power BI | Microsoft Learn

Hi @TrevLc Thanks for pointing this out. But have you been able to make it work with the "commas" to divde the number by 1000, 1000000 etc.? I tried but it does not seem like it is implemented in the Dynammic format strings?

Candicew
Regular Visitor

Screenshot 2023-08-11 182835.png

hi i am wondering if someone could helpme. i tried to change the format to currency and seted up with two decimal places. i got everything righ in other chart but not this multi-row card. I don't know why.

 

If these are measures, make sure it is set on the measure itself

TrevLc_0-1691969117012.png

I have set this and it seems to work for me

TrevLc_1-1691969206365.png

 

Abhinav2194
New Member

Abhinav2194_0-1672213123391.png

In the above screenshot, you can see I have selected the measure - "Total Revenue".

Under the format Tab, the format Is General.

---- Switch the format to Currency.

---- Also adjust the decimal points to two places.

DONE.

Abhinav2194_1-1672213366276.png

Abhinav2194_2-1672213379722.png

Check the above screenshot. You can check the card which shows Monthly revenue and check the values as they add a "K" or "M" when required.

I

 

TrevLc
Helper III
Helper III

I am looking for a solution to this too if anyone knows of one?

Rather than writing it into a measure, I would like to do it using the dropdown option to select custom format like you do in Excel

DanielG123
Regular Visitor

Hi, 

I have also encountered the same issue and was wondering has anyone found a solution for this yet. Even when i set the 

[>=1000000] #,##0.00,,"m";[<1000000] #,##0.0,"k";General

in excel and import into PowerBi, it will clear this.  

amitchandak
Super User
Super User

Refer

https://radacad.com/custom-format-fields-and-measures-in-power-bi

https://community.powerbi.com/t5/Desktop/Measures-editing-number-formats/td-p/240597

 

 

Measure = FORMAT( sales[sales], $#,##0;($#,##0) )

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi,

Thanks for the reply - I think maybe you misunderstood the question slightly: I'm looking to use custom formatting in the Model view to do this rather than in a measure. The ultimate goal being that I can do a quick, non-destructive change to a number's format rather than having to go a write a measure everytime (as per the SWITCH suggestion in my original post). The RADACAD article is useful, but only really for date formats.

 

Custom format in Model viewCustom format in Model view

 

Thanks,

 

SamB

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.