Forum Discussion
powerlight1
Helper I
1 year agoHelp with Filtering Using A Separate Table
Hi, I need help with filtering using a separate table and calculating an average based on filtered records. I have a Sales table Date, Sales 1/11/2024, 1 2/11/2024, 2 3/11/2024, 3 4/11/2024,...
- 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.
powerlight1
Helper I
1 year agoThanks Shahid12523
That worked. I'm new to PBI so was wondering why didn't the Filter Measure I created and placed in the visual's filter did the job?