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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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