Welcome, Guest
Username Password: Remember me
Please ask here your questions related to DAX and PowerPivot for Excel or PowerPivot for SharePoint. To post your question or reply you need to login first!
  • Page:
  • 1

TOPIC: Understanding Filter Context

Understanding Filter Context 1 year, 6 months ago #147

  • LoganIsDax
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
I'm trying to understand more about filter/row context. Here's an example:

TableA.......TableB..........LookupTable
[ColumnX]..[ColumnY]...[Code]
A...................A....................A
B...................B....................B
C...................C....................C
A...................A
A...................B
B...................B
....................C

Relationships:
TableA[ColumnX]->LookupTable[Code]
TableB[ColumnY]->LookupTable[Code]

Measures:
[Measure 1] = SUMX(TableA,COUNTROWS(TableA))
[Measure 2] = SUMX(TableB,[Measure 1])

PivotTable:
Row Labels = TableB[ColumnY]
Values = [Measure 2]

The result is:
A 18
B 12
C 2

But now assume I replace "[Measure 1]" with its actual formula ("SUMX(TableA,COUNTROWS(TableA))") within [Measure 2]. Now I will get:
A 72
B 108
C 72

Why does this happen? When I nest [Measure 1] in [Measure 2] does TableA respect TableB's filter context, but if I use just the formula instead, TableA does not respect TableB's filter context?

Please let me know if I can explain this any better.
  • Page:
  • 1
Moderators: Vidas, dgosbell
Time to create page: 0.22 seconds
 

Varigence Vivid