Forum Discussion
Anonymous
3 years agoNot applicable
Displaying the same data under another table - using USERELATIONSHUP() maybe?
Hi, I have a table Sales that is linked to two date tables Date1 and Date2. Let's assume that the data looks like this: Now I need the measure Sales to display the same data as on the ...
- 3 years ago
Hi Anonymous
Please refer to attached sample file with the solutionSales Date2 = SUMX ( VALUES ( 'Date 1'[Month] ), CALCULATE ( VAR CurrentMonth = MAX ( 'Date 1'[Month Number] ) VAR Dates = FILTER ( VALUES ( 'Date 2'[Date] ), MONTH ( 'Date 2'[Date] ) = CurrentMonth ) VAR Result = CALCULATE ( [Sales Amount], TREATAS ( Dates, Sales[Order Date] ), REMOVEFILTERS ( 'Date 1' ) ) RETURN Result ) )
tamerj1
3 years agoCommunity Champion
Hi Anonymous
Try using TREATAS
Sales =
CALCULATE (
SUM ( Sales[Sales] ),
TREATAS ( VALUES ( Date1[Date] ), Date2[Date] )
)
Anonymous
3 years agoNot applicable
- tamerj13 years agoCommunity Champion
Anonymous
Seems I wrote it the other way around. Please try
Sales = CALCULATE ( SUM ( Sales[Sales] ), TREATAS ( VALUES ( Date2[Date] ), Date1[Date] ) )- Anonymous3 years agoNot applicable
Hi tamerj1 , I've tried both ways and I'm getting odd numbers.
Thank you
- tamerj13 years agoCommunity Champion
Anonymous
Sorry I just saw your reply. Please try with REMOVEFILTERS
Sales = CALCULATE ( SUM ( Sales[Sales] ), TREATAS ( VALUES ( Date2[Date] ), Date1[Date] ), REMOVEFILTERS ( Date1 ) )