Skip to main content

Power BI

New

Dynamic Column Names in a table

Vote (57) Share
Sahil Bansal's profile image

Sahil Bansal on 06 Apr 2017 18:21:20

Column names must be dynamic i.e. we should be able to change the column names in a Table/Matrix

Comments (6)
Sahil Bansal's profile image Profile Picture

a779d9c7 32b8-4068-b22d-59455b5f532b on 06 Jul 2020 00:02:32

RE: Dynamic Column Names in a table

A dynamic column name would be necessary not just for matrix, but with plain tables, where the column values could be dictated by a slicer selection and the column would be nice to have a specific name based on that selection.

Sahil Bansal's profile image Profile Picture

51af57f3 78fe-476d-aebf-cdb52004f81a on 05 Jul 2020 23:55:46

RE: Dynamic Column Names in a table

I tried to put a card on top of the table, but it doesn't work on mobile visualization. We NEED this! Calling a column "Actual year" is not as attractive as calling it "2019"

Sahil Bansal's profile image Profile Picture

5322a1c0 66ab-4936-8558-fade89446447 on 05 Jul 2020 23:48:41

RE: Dynamic Column Names in a table

'@Sebastian, you can achieve your required output today by putting the year attribute on the columns then changing the measure expression to the following

= calculate(sum(value); FILTER(VALUES('Date'[Year]), 'Date'[Year] = year(today () )-2))

This measure will only return a value against the current year, it will return blanks against any other year which Power BI will automatically filter out.

Sahil Bansal's profile image Profile Picture

846a04bb bf65-420e-a65b-a2efa1cd859d on 05 Jul 2020 23:46:21

RE: Dynamic Column Names in a table

A work around world be to use measures and a card

Sahil Bansal's profile image Profile Picture

efa7f721 efa1-4b3a-ae19-40909d65f130 on 05 Jul 2020 23:06:38

RE: Dynamic Column Names in a table

We would also need this.
For example you calculate a value for a special year with the following measure

name = calculate(sum(value); year(date) = year(today () )-2)

It would be nice if the column name would be the year of the value which is calculated by the measure.

Sahil Bansal's profile image Profile Picture

b7bd0a3b 498c-496b-8932-fc3fea62c017 on 05 Jul 2020 22:49:26

RE: Dynamic Column Names in a table

Hi Sahil, Did you got any break through on Dynamic Column Names. Please share.