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
cristianj
Helper IV
Helper IV

I want to use a selectable value in a dax querry

Hello, i have this dax <<

PostatLaVanzare2 =
var datadeales=SELECTEDVALUE('Date'[Date].[Date])
return
CALCULATETABLE(
summarize(
Filter(order_state_updates,order_state_updates[created_at]<date(2022,4,28)+(5/24) ), 
order_state_updates[order_id],
"LastState",LASTNONBLANKVALUE(order_state_updates[id],max(order_state_updates[order_state]))
)

>>

and what i want is to replace the date(2022,4,28)+(5/24), with a selectable value from the interface, so when i select another date, i will get the right result, i did try with selectedvalue, but the i replace tha date with variable it returns 0 values. if you could give me an ideea . thank you

3 REPLIES 3
AlexisOlson
Super User
Super User

You can only have dynamically calculated tables within measures. If you load a table as part of the model, it cannot be responsive to slicers.

 

The workaround is to recreate whatever logic this table is being used for within measures. But since I don't know what your ultimate goal is with this table it's hard to advise what measures to write.

amitchandak
Super User
Super User

@cristianj , You can not use slicer value in a calculated table.

 

You can use it table created as var in measure

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

and any other way to filter by a value which i select? because, in that dax i need to filter by date, i have an table with all the day of the last 2 years, but i need to use it dinamically, i don;t know another way.

thank you

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.