Mickey Mouse
New Member
- Joined
- Jan 22, 2013
- Messages
- 2
Hello Excel-Gurus,
I am struggling with PowerPivot and could not find an answer or solution for my problem searching the net.
It has to do with a many-to-many relationship and trying to filter a pivot table by two columns combined with an or and not and but let me give a short example.
TABLE1
[TABLE="class: grid, width: 250"]
<tbody>[TR]
[TD]ID[/TD]
[TD]KST-USER[/TD]
[TD]KST-OWNER[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]10[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]20[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]10[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]30[/TD]
[TD]30[/TD]
[/TR]
</tbody>[/TABLE]
TABLE2
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD]KST-ID[/TD]
[TD]KST-NAME[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]C[/TD]
[/TR]
</tbody>[/TABLE]
I have two relationships to get the KST-NAME:
TABLE1[KST-USER] - TABLE2[KST-ID] (n:1)
TABLE1[KST-OWNER] - TABLE2[KST-ID] (m:1)
I would like to have a PowerPivotTable with the following content:
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD]COUNTA[ID][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
COUNTA[A] counts/shows the rows, which belongs to the KST-NAME in KST-USER OR KST-OWNER.
It should display double clicking the number 3 for example all the rows belonging to the KST-A:
[TABLE="class: grid, width: 250"]
<tbody>[TR]
[TD]ID[/TD]
[TD]KST-USER[/TD]
[TD]KST-OWNER[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]10[/TD]
[TD]11
[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]20[/TD]
[TD]10
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]10
[/TD]
[TD]10
[/TD]
[/TR]
</tbody>[/TABLE]
I already read the blog-posts from Marco Russo and Alberto Ferrari as well as the one from gbrueckl
Resolving Many to Many relationships leveraging DAX Cross Table Filtering « Gerhard Brueckl's BI Blog
I start playing around with LOOKUPVALUE and USERELATIONSHIP in DAX but could not figure out a way to solve my problem.
"Relationships are always equivalent to left outer joins (see MDX and DAX topics: The Logic behind the Magic of DAX Cross Table Filtering ), and context propagates automatically in one direction."
So is there a solution or is it not possible so solve this with Excel and PowerPivot?
I am struggling with PowerPivot and could not find an answer or solution for my problem searching the net.
It has to do with a many-to-many relationship and trying to filter a pivot table by two columns combined with an or and not and but let me give a short example.
TABLE1
[TABLE="class: grid, width: 250"]
<tbody>[TR]
[TD]ID[/TD]
[TD]KST-USER[/TD]
[TD]KST-OWNER[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]10[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]20[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]10[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]30[/TD]
[TD]30[/TD]
[/TR]
</tbody>[/TABLE]
TABLE2
[TABLE="class: grid, width: 150"]
<tbody>[TR]
[TD]KST-ID[/TD]
[TD]KST-NAME[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD]C[/TD]
[/TR]
</tbody>[/TABLE]
I have two relationships to get the KST-NAME:
TABLE1[KST-USER] - TABLE2[KST-ID] (n:1)
TABLE1[KST-OWNER] - TABLE2[KST-ID] (m:1)
I would like to have a PowerPivotTable with the following content:
[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD][/TD]
[TD]COUNTA[ID][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
COUNTA[A] counts/shows the rows, which belongs to the KST-NAME in KST-USER OR KST-OWNER.
It should display double clicking the number 3 for example all the rows belonging to the KST-A:
[TABLE="class: grid, width: 250"]
<tbody>[TR]
[TD]ID[/TD]
[TD]KST-USER[/TD]
[TD]KST-OWNER[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]10[/TD]
[TD]11
[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]20[/TD]
[TD]10
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]10
[/TD]
[TD]10
[/TD]
[/TR]
</tbody>[/TABLE]
I already read the blog-posts from Marco Russo and Alberto Ferrari as well as the one from gbrueckl
Resolving Many to Many relationships leveraging DAX Cross Table Filtering « Gerhard Brueckl's BI Blog
I start playing around with LOOKUPVALUE and USERELATIONSHIP in DAX but could not figure out a way to solve my problem.
"Relationships are always equivalent to left outer joins (see MDX and DAX topics: The Logic behind the Magic of DAX Cross Table Filtering ), and context propagates automatically in one direction."
So is there a solution or is it not possible so solve this with Excel and PowerPivot?