Forum Discussion

bodaypal's avatar
bodaypal
Regular Visitor
8 years ago

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:

 

IDGENDERAGE_GOURPEDUCATIONNO_PEOPLE
1M20-30primary12
2F30-40secondary23
3M30-40primary12
4F20-30tertiary24
5F40-50secondary32
6M40-50primary21
7M20-30tertiary32
8F30-40secondary12
9F20-30tertiary32
10F40-50primary14

 

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