Forum Discussion
Filtering Dates from another table
- 1 year ago
Hi riledup2021 ,
Thank you for reaching out to the Microsoft Community Forum.
Hi lbendlin , FBergamaschi , Thank you for your prompt responses.
Hi riledup2021 ,
Please try below two options to improve performance.
1. Created Calculated column "IsR1W" to "time_rollup"
IsR1W = IF(time_rollup[timerollupdimcd] = "r1w", TRUE(), FALSE())
Please change you "R1W Sales" measure with below DAX code.
R1W Sales = CALCULATE(
SUM('Sales Metrics - Weekly'[sales]),
FILTER(
'Sales Metrics - Weekly',
'Sales Metrics - Weekly'[invoicedt] IN
CALCULATETABLE(
VALUES(time_rollup[rollupdt]),
time_rollup[IsR1W] = TRUE()
)
)
)
2. Create a date bridge table from "time_rollup", only include rows with "r1w" and their "rollupdt". Make relationship "rollupdt" --> "invoiced" directly in the model.Use the time filter from Time_R1W
R1W Sales = SUM('Sales Metrics - Weekly'[sales])
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
If you refresh your calendar table in import mode daily you can implement these ranges/grains as calculated columns.