Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Good morning,
I have a situation like this:
and I'm replicating it as a matrix.
But I was asked if I can change the view to this:
how can i put two values in a field aligned in the center?
or, if I can't do the above, I wish I could replicate a situation like this:
How can I put a space before the field name?
thanks everyone for the help
Best regards
Solved! Go to Solution.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
KPI:
Then you need to make 'KPI1', 'KPI2', 'KPI3' selected and unpivot them.
There is no relationship between tables. You may create a measure as below.
Result =
var t =
ADDCOLUMNS(
CROSSJOIN(
DISTINCT('KPI'[New KPI]),
DISTINCT('Table'[Year])
),
"Result",
IF(
[New KPI]="KPI1",
CONCATENATEX(
FILTER(
ALL('Table'),
[KPI] in {"KPI1","KPI2"}&&
[Year]=EARLIER('Table'[Year])
),
[Value],
UNICHAR(10)
),
CONCATENATEX(
FILTER(
ALL('Table'),
[KPI]=EARLIER('KPI'[New KPI])&&
[Year]=EARLIER('Table'[Year])
),
[Value],
UNICHAR(10)
)
)
)
return
CONCATENATEX(
t,
[Result],
UNICHAR(10)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
KPI:
Then you need to make 'KPI1', 'KPI2', 'KPI3' selected and unpivot them.
There is no relationship between tables. You may create a measure as below.
Result =
var t =
ADDCOLUMNS(
CROSSJOIN(
DISTINCT('KPI'[New KPI]),
DISTINCT('Table'[Year])
),
"Result",
IF(
[New KPI]="KPI1",
CONCATENATEX(
FILTER(
ALL('Table'),
[KPI] in {"KPI1","KPI2"}&&
[Year]=EARLIER('Table'[Year])
),
[Value],
UNICHAR(10)
),
CONCATENATEX(
FILTER(
ALL('Table'),
[KPI]=EARLIER('KPI'[New KPI])&&
[Year]=EARLIER('Table'[Year])
),
[Value],
UNICHAR(10)
)
)
)
return
CONCATENATEX(
t,
[Result],
UNICHAR(10)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
How is the raw data? Is it all in one table? Do you have a Category table that shows that KPI 1 and KPI 2 are part of the same category? If you have this, you could use the stepped layout in matrix to Off, and set Category and KPI as rows.
For example add a table like:
| Category | KPI |
| A | KPI 1 |
| A | KPI 2 |
| B | KPI 3 |
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 44 | |
| 40 | |
| 29 | |
| 19 |
| User | Count |
|---|---|
| 200 | |
| 126 | |
| 103 | |
| 70 | |
| 53 |