Forum Discussion
Based on Invoice Date filter, create two separate columns
- 4 years ago
Dear apatwal
Columns do not have access to the filter context and hence cannot read any filter. However, you can achieve the same by creating two measures as the values of a matrix visual sliced by transaction number or any other column.
Supposing that the date filter will come only from the slicer (meaning it is not part of the visual) then the first measure can be:Net Change in Cost $ - Full Date = CALCULATE ( SUM ( 'Table'[Net Change in Cost $] ), ALLSELECTED ( 'Table'[Invoice Date] ) )For the 2nd measure try
Net Change in Cost $ - Last 4 Weeks = VAR EndtDate = MAX ( 'Table'[Invoice Date] ) VAR StartDate = EndtDate - 28 VAR Result = CALCULATE ( SUM ( 'Table'[Net Change in Cost $] ), FILTER ( 'Table', 'Table'[Invoice Date] < EndtDate && 'Table'[Invoice Date] >= StartDate ) ) RETURN ResultPlease let me know if works. If so kindly mark my reply as accepted solution. Thank you!
Hi apatwal
You cannot use time intelligence functions without a standard Date table. Have you tried my approach?
Hi tamerj1 ,
I even tried using your approach, which gives me same result as of mine DAX.
But I came to know that time intelligence functions have pre-requisite that Date table should be available in model.
Just want to know is there any article or any resource which can suggest us any drawbacks or issues that arises if we use Time intelligence when we don't have standard date table?