Forum Discussion
Table Viz with DAX Calculated Dimension Column
Hi All - I would greatly appreciate thoughts on the below issue that has stumped me.
I am attempting to create a simple table viz in PBI Desktop that includes a calculated column from one table based on a LOOKUPVALUE formula referencing columns in a separate table. The logic is to look for a certain value from Table 1 in one column of Table 2, and, if found, transform it to the corresponding value in a different column of Table 2. If the value is not found in Table 2, the calculated column is populated by the original value from Table 1.
Calculated Column Formula:
- Anonymous4 years ago
Hi Matthew1900 ,
I created some data:
Table1:
Table2:
Here are the steps you can follow:
1. Create calculated column.
Calculated Column Formula = var _Table1= SELECTCOLUMNS('Table2',"1",[Group]) return IF( 'Table1'[Group] in _Table1, CALCULATE( SUM('Table2'[Amount2]),FILTER(ALL(Table2),'Table2'[Group]='Table1'[Group])) ,'Table1'[Amount])2. 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
2 Replies
- Ashish_MathurSuper User
Hi,
Share some data, describe the question and show the expected result.
- AnonymousNot applicable
Hi Matthew1900 ,
I created some data:
Table1:
Table2:
Here are the steps you can follow:
1. Create calculated column.
Calculated Column Formula = var _Table1= SELECTCOLUMNS('Table2',"1",[Group]) return IF( 'Table1'[Group] in _Table1, CALCULATE( SUM('Table2'[Amount2]),FILTER(ALL(Table2),'Table2'[Group]='Table1'[Group])) ,'Table1'[Amount])2. 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