Forum Discussion
Secondary data table not filtering from slicer
- 6 years ago
Solved using TreatAs()
GI from Forecast = CALCULATE( SUM('GI from Forecast 2020 sheet'[Value]), TREATAS( SUMMARIZE(DateTable,DateTable[Year],DateTable[MonthOfYear]), 'GI from Forecast 2020 sheet'[Year], 'GI from Forecast 2020 sheet'[MonthNumber] ) )
Referencing this guide from SQLBI.
I still have the bridge table for the client name, but the Date bridge didn't work as it created too many filter paths for my setup. However, passing the filter context to the secondary table using Treatas worked... a treat.
Thanks for the assist guys.
catnapwat , Join are one to Many?
amitchandak Here's the relationships that are relevant in this case.
I don't know how to get the DateTable filtering the "GI from Forecast" table and I can't connect it directly. Should it filter without a relationship?
- Greg_Deckler6 years ago
Community Champion
catnapwat - Your slicer should be based on your bridge table, right?
- catnapwat6 years ago
Helper I
Greg_Deckler my slicer is based on my central Date table. Are you saying I need two bridge tables- Brand and Date?
- catnapwat6 years ago
Helper I
Solved using TreatAs()
GI from Forecast = CALCULATE( SUM('GI from Forecast 2020 sheet'[Value]), TREATAS( SUMMARIZE(DateTable,DateTable[Year],DateTable[MonthOfYear]), 'GI from Forecast 2020 sheet'[Year], 'GI from Forecast 2020 sheet'[MonthNumber] ) )
Referencing this guide from SQLBI.
I still have the bridge table for the client name, but the Date bridge didn't work as it created too many filter paths for my setup. However, passing the filter context to the secondary table using Treatas worked... a treat.
Thanks for the assist guys.