Forum Discussion
Seeking help for Dynamic number formatting in PowerBi
- Anonymous4 years ago
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" ) ) )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
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")
))
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?
- Anonymous4 years agoNot 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" ) ) )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