Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
meowster
Frequent Visitor

Lookup date value applied on filter not working

Hello, 

 

I am trying to use a date value from lookup as a variable for a filter but it doesn't seem to work. My DAX formula is shown as below:

Table =
VAR SelectedSalesDate = LOOKUPVALUE(
    'DIM_SalesDate'[Last day of sales month],
    'DIM_SalesDate'[DateText YYYY-MM],
    SELECTEDVALUE('DIM_SalesDate'[DateText YYYY-MM])
)
RETURN
    FILTER('FACT_Main',
        'FACT_Main'[Last day of sales month] >= SelectedSalesDate &&
        'FACT_Main'[Application Date] <= SelectedSalesDate &&
    )
 
The above DAX does not return any syntax error and returns a blank table instead. Did this happen because the lookup value is not recognised as a date value? How can I fix this? Thank you!
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can't use SELECTEDVALUE when creating a table. Calculated tables are only calculated during data load or refresh, so they don't pay any attention to slicers or filters. If you need something to react dynamically to filters or slicers you need to do it in a measure.

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You can't use SELECTEDVALUE when creating a table. Calculated tables are only calculated during data load or refresh, so they don't pay any attention to slicers or filters. If you need something to react dynamically to filters or slicers you need to do it in a measure.

Thank you @johnt75 for this info. Didn't know about this. I've managed to find a workaround by summarizing the data into another table and then apply the filters from there.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.