Forum Discussion
Dynamic column value based on MEASURE (not Slicer)
Hi there,
I am looking for a solution for the following problem.
I would like to create a new column to a table that takes its values as a condition based on a measure. I know, I can be solve it with slicer by unpivoting all dimensions to one table but my source table should be refreshed quite often and I do not want to make this unpivot stuff every time.
So the example, I have a table named e.g. EMPLOYEES:
| ID | GENDER | AGE_GOURP | EDUCATION | NO_PEOPLE |
| 1 | M | 20-30 | primary | 12 |
| 2 | F | 30-40 | secondary | 23 |
| 3 | M | 30-40 | primary | 12 |
| 4 | F | 20-30 | tertiary | 24 |
| 5 | F | 40-50 | secondary | 32 |
| 6 | M | 40-50 | primary | 21 |
| 7 | M | 20-30 | tertiary | 32 |
| 8 | F | 30-40 | secondary | 12 |
| 9 | F | 20-30 | tertiary | 32 |
| 10 | F | 40-50 | primary | 14 |
I have an other table named Dimensions
| DIMENSIONS |
| GENDER |
| AGE_GOURP |
| EDUCATION |
I can create a measure FILTEREDED_DIM that takes its values by selecting (filtering) an element from 'Dimensions'[DIMENSIONS]
let's say
FILTERED_DIM = if(
ISCROSSFILTERED('Dimensions'[DIMENSIONS]);
FIRSTNONBLANK('Dimensions'[DIMENSIONS];
""))
I would like to create a new column to the table EMPLOYEES e.g. CHOSEN_DIM that takes its values based on the value of the measure FILTERED_DIM
something like this:
CHOSEN_DIM = IF(
[FILTERED_DIM]="AGE_GROUP";'Employees'[AGE_GOURP];
if([FILTEREDED_DIM]="EDUCATION";'Employees'[EDUCATION];
'Employees'[GENDER]
)
)
It results always as false...
Do you have any idea, work arround? Or even the idea is not suited for PBI, that is why I did not find any solution already. If so, any idea on how to recreate automatically my unpivoted table.
Thanks
Pal