Forum Discussion
camarillob
1 year agoFrequent Visitor
Categorizing 3 Columns into a Category
Hi all,
Please help me on how I could create a relationship on these two tables.
Some key points for this
- For Table B, all blank values are null.
- For Table B, some categories are duplicated, but ALL values (from CLASS1-3) are unique.
- Im looking for a way so that when I present a matrix and use values from Table A, it will output the category from Table B without issues.
Sample Output:
Hey camarillob
here is the solution
create a calculated column in both the tableUnique id =var a = IF(LEN(Sheet2[CLASS1])> 1 ,"", Sheet2[CLASS1])var b = IF(LEN(Sheet2[CLASS2])> 1 ,"", Sheet2[CLASS2])var c = IF(LEN(Sheet2[CLASS3])> 1 ,"", Sheet2[CLASS3])RETURNCONCATENATE(a,CONCATENATE(b,c))Unique id =var a = IF(LEN(Sheet1[CLASS1])> 1 ,"", Sheet1[CLASS1])var b = IF(LEN(Sheet1[CLASS2])> 1 ,"", Sheet1[CLASS2])var c = IF(LEN(Sheet1[CLASS3])> 1 ,"", Sheet1[CLASS3])RETURNCONCATENATE(a,CONCATENATE(b,c))
then make the realtionship and the drag the column in table.Here is the file
Solved PBIX
if it helps please Kudos to work and Accept it as Solution
1 Reply
- elitesmitpatel
Solution Supplier
Hey camarillob
here is the solution
create a calculated column in both the tableUnique id =var a = IF(LEN(Sheet2[CLASS1])> 1 ,"", Sheet2[CLASS1])var b = IF(LEN(Sheet2[CLASS2])> 1 ,"", Sheet2[CLASS2])var c = IF(LEN(Sheet2[CLASS3])> 1 ,"", Sheet2[CLASS3])RETURNCONCATENATE(a,CONCATENATE(b,c))Unique id =var a = IF(LEN(Sheet1[CLASS1])> 1 ,"", Sheet1[CLASS1])var b = IF(LEN(Sheet1[CLASS2])> 1 ,"", Sheet1[CLASS2])var c = IF(LEN(Sheet1[CLASS3])> 1 ,"", Sheet1[CLASS3])RETURNCONCATENATE(a,CONCATENATE(b,c))
then make the realtionship and the drag the column in table.Here is the file
Solved PBIX
if it helps please Kudos to work and Accept it as Solution