Howdy Folks! In this post, I am going share an interesting technique to apply Indian Comma Separator format to your numbers in Power BI.
Indian Comma Format in Power BI – Video
Consider a random Sales Value
- To apply the Indian comma format, let’s create a calculation group using Tabular Editor.
- Each calculation group allows to create a dynamic string expression (in English that means – using some sort of DAX logic to dynamically format the measures)
I created the following calculation group with an Expression and Dynamic Format String Expression.
The Calculation Item will contain the following DAX Expression
SELECTEDMEASURE()
DAX used in the Format String Expression
VAR Length = LEN(INT(SELECTEDMEASURE())) VAR Formatting = SWITCH( TRUE(), Length <= 3, '0.0', Length <= 5, '##,##0.0', Length <= 7, '##\,##\,##0.0', Length <= 9, '##\,##\,##\,##0.0' ) RETURN Formatting
- Save it
- Return to Power BI and refresh the Model.
- Select the Name Column in the calculation group table and convert it into a slicer
Once the slicer is selected it displays the India Comma Formatting Style for all measure values on the canvas.
More on DAX and Power BI