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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Anonymous
Not applicable

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

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")
))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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?

Anonymous
Not applicable

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

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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