Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Hi All,
Please suggest how to add Column having space (customised based on need) based on data in existing column, so that when i use this New column into Martix table it should retain format Ex: below.
Thank you.
Solved! Go to Solution.
You can create a calculated column. However, you'll need to ensure the Text Wrap for your values is off
Here is an approach in Power Query that uses non-breaking spaces (unicode 160). Non-breaking spaces won't get collapsed like regular spaces do in certain contexts (like when displayed in row headers). I added some inputs (LevelWeight, LevelLookup) that let you assign/update spacing a little more easily and transparently.
You can see how this works if you paste into Advanced Editor in Power Query. You can copy the relevant steps over to your own query, just be sure to update for column name differences. It's possible to do something very similar with DAX in a calculated column if needed.
let
Source = Table.FromColumns(
{{"Type 1","Type 2","Type 3","Type 4","Type 5","Type 6"}},
type table [Accounts = text]
),
LevelWeight = 3,
LevelLookup = [ Type 1 = 0, Type 2 = 2, Type 3 = 1, Type 4 = 1, Type 5 = 0, Type 6 = 0 ],
AddExpectedResult =
Table.AddColumn(
Source,
"Expected result",
each Text.Repeat(
Character.FromNumber( 160 ) ,
Record.Field( LevelLookup, [Accounts] ) * LevelWeight
) & [Accounts],
type text
)
in
AddExpectedResult
Table in Power Query:
Put into a matrix and you can see that spacing is not collapsed.
Note that to have [Expected result] ignore the spacing when sorting, you will need to set the column's 'Sort by column' setting to [Accounts].
Thank you so much for taking time on this.
You can create a calculated column. However, you'll need to ensure the Text Wrap for your values is off
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |