Forum Discussion
Create a Conditional Table that creates a newly summarized table that enforces filters.
- Anonymous4 years ago
Hi Kyle21 ,
Here are the steps you can follow:
1. Go to Power query and copy the Table.
2. Select 5 columns in Table2 -- Unpivot columns.
3. In the table formed by Unpivot columns, select [Value] – Remove.
4. Select [Attribute] – Remove Duplicates.
Result:
5. Create calculated column.
Code = SWITCH( TRUE(), 'Table2'[Attribute]="Type","TY001", 'Table2'[Attribute]="Name","NA001", 'Table2'[Attribute]="Status","ST001", 'Table2'[Attribute]="isVIP","VIP001", 'Table2'[Attribute]="Account No","AN001")Description = SWITCH( TRUE(), 'Table2'[Attribute]="Type","Type is Required", 'Table2'[Attribute]="Name","Name is Required", 'Table2'[Attribute]="Status","Status is Required", 'Table2'[Attribute]="isVIP","A value is Required", 'Table2'[Attribute]="Account No","Account Number is Required")Exceptions = SWITCH( TRUE(), 'Table2'[Attribute]="Type",0, 'Table2'[Attribute]="Name",0, 'Table2'[Attribute]="Status",1, 'Table2'[Attribute]="isVIP",0, 'Table2'[Attribute]="Account No",1)6. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Kyle21 ,
Here are the steps you can follow:
1. Go to Power query and copy the Table.
2. Select 5 columns in Table2 -- Unpivot columns.
3. In the table formed by Unpivot columns, select [Value] – Remove.
4. Select [Attribute] – Remove Duplicates.
Result:
5. Create calculated column.
Code =
SWITCH(
TRUE(),
'Table2'[Attribute]="Type","TY001",
'Table2'[Attribute]="Name","NA001",
'Table2'[Attribute]="Status","ST001",
'Table2'[Attribute]="isVIP","VIP001",
'Table2'[Attribute]="Account No","AN001")Description =
SWITCH(
TRUE(),
'Table2'[Attribute]="Type","Type is Required",
'Table2'[Attribute]="Name","Name is Required",
'Table2'[Attribute]="Status","Status is Required",
'Table2'[Attribute]="isVIP","A value is Required",
'Table2'[Attribute]="Account No","Account Number is Required")Exceptions =
SWITCH(
TRUE(),
'Table2'[Attribute]="Type",0,
'Table2'[Attribute]="Name",0,
'Table2'[Attribute]="Status",1,
'Table2'[Attribute]="isVIP",0,
'Table2'[Attribute]="Account No",1)
6. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly