Forum Discussion
Help with Filtering Using A Separate Table
- 1 year ago
Your slicer table isn’t filtering Sales, so the average uses all 6 days.
Fix: Create a measure with TREATAS
Avg Sales by Slicer =
CALCULATE(
AVERAGE(Sales[Sales]),
TREATAS(VALUES(slicer_date[Date]), Sales[Date])
)
Now the slicer dates will filter Sales, and the average for 1–5 Nov will return 3.Alternative: just relate slicer_date[Date] → Sales[Date] directly.
Hi,
As long as the reaulationship between dates is properly set up (Many to One and Single) and the slicer is from the date table, this simple measure should work
Avg = average(Data[Sales])
Hope this helps.
I must explain, I can't set up a relationship between my Sales table and my slicer_date table because I have a second slicer_date2 table allowing the user the flexibility to select 2 different sets of dates from 2 different slider_date tables and returning both date period calcuation.