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
DanielG123
Regular Visitor

Seeking help for Dynamic number formatting in PowerBi

Hi All, 

 

I was hoping someone can help me use some dynamic formatting for vlaues in PowerBi. I need a solution to provide a K for values, such as 141K and M for values, such as 1.23M. This can be done in Excel using 

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

but is there a way to impliment this into PowerBi? 

 

Appreciate any ideas 🙂  

1 ACCEPTED SOLUTION

Hi  @DanielG123 ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a calculated column as below:

Column = 
IF (
    [Value] >= 1000000,
    FORMAT ( DIVIDE ( [Value], 1000000 ), "0.00M" ),
    IF (
        [Value] >= 1000
            && [Value] < 1000000,
        FORMAT ( DIVIDE ( [Value], 1000 ), "0.00K" ),
        FORMAT ( [Value], "0.00" )
    )
)

yingyinr_0-1658392948891.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

4 REPLIES 4
amitchandak
Super User
Super User

@DanielG123 , You have try a measure like

 

SWITCH ( TRUE() ,
[M1] >= 1000000000 , CONCATENATE("$", FORMAT ([M1]/1000000000, "#,###.0") & "bn") ,
[M1] >= 1000000, CONCATENATE("$", FORMAT (COALESCE([M1], 0)/1000000, "#,###.0" )& "M") ,
[M1] >= 1000, CONCATENATE("$", FORMAT (COALESCE([M1], 0)/1000000, "#,###.0" )& "K") ,
CONCATENATE("$", FORMAT (COALESCE([M1], 0) , "#,###.0")
))

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

Hi, 

 

So where you have the [M1] in the formula, i am replacing that with my column name. However it will not find the column. It is a whole number column, do i need to put it in a calculated field?

Hi  @DanielG123 ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a calculated column as below:

Column = 
IF (
    [Value] >= 1000000,
    FORMAT ( DIVIDE ( [Value], 1000000 ), "0.00M" ),
    IF (
        [Value] >= 1000
            && [Value] < 1000000,
        FORMAT ( DIVIDE ( [Value], 1000 ), "0.00K" ),
        FORMAT ( [Value], "0.00" )
    )
)

yingyinr_0-1658392948891.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

Hi @amitchandak

 

I will try this and let you know if it works. The values are not currencies, they are just volume figures for the amount of users etc. 

 

Will come back here if it works to let you know 🙂 

 

Thanks

 

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.