Forum Discussion
Avoid filter other Tables
Hi,
When I calculate cumulative progress, it is 0.25 percent greater than total due to the relationship between the date dimension table and the other two tables. The outcome is satisfactory when I disable the relationship with the 3Dmodel table.
How can a filter be applied only to the date table using DAX?
Overall_Total Actual Prgrs =
[Overall_Eng_Actual_Prgrs]+[Overall_3Dmodel_Actual_prgrs]+[Overall_Benchmark_Actual_prgrs]
Overall_Actual_Cumulative_Prgrs =
CALCULATE (
[Overall_Total Actual Prgrs],
FILTER (
ALLSELECTED ( 'DIM Calendar' ),
'DIM Calendar'[Date]
<= MAXX( FILTER( 'DIM Calendar',
'DIM Calendar'[Date] <= TODAY()),
'DIM Calendar'[Date])
)
)
Result when relationship is active
Data Model
Try
Overall_Actual_Cumulative_Prgrs = VAR MaxDate = CALCULATE ( MAX ( 'DIM Calendar'[Date] ), 'DIM Calendar'[Date] <= TODAY () ) RETURN CALCULATE ( [Overall_Total Actual Prgrs], ALLSELECTED ( 'DIM Calendar' ), 'DIM Calendar'[Date] <= MaxDate )
4 Replies
- johnt75
Super User
Change the relationships from the date table to all the other tables to be one-to-many single-direction relationships.
- ajisharavind_99
Advocate I
johnt75 Still same
- johnt75
Super User
Try
Overall_Actual_Cumulative_Prgrs = VAR MaxDate = CALCULATE ( MAX ( 'DIM Calendar'[Date] ), 'DIM Calendar'[Date] <= TODAY () ) RETURN CALCULATE ( [Overall_Total Actual Prgrs], ALLSELECTED ( 'DIM Calendar' ), 'DIM Calendar'[Date] <= MaxDate )