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

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

Reply
Anonymous
Not applicable

How to get user selected date as a variable in DAX

Hello everyone,

 

I have created DAX queries to calculate counts of various records. These DAX queries works based on last_week_start_date, last_week_end_date, next_week_start_date and next_week_end_date. 

 

I was thinking is there a way I can accept user input for these 4 variables so that I no need to hardcode any dates in DAX.

 

Thanks,

Karthik

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Two date ranges?

But remember you can not initialize the date ranges 

How to use two Date/Period slicers: https://youtu.be/WSeZr_-MiTg

 

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=35

 

or week vs Week

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

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
Anonymous
Not applicable

Hello @amitchandak ,

 

Thanks for your response but my requirement was different than your solution. But anyway thanks for your reply.

Hi @Anonymous ,

 

What do you mean about accepting user input? Does it mean selecting a value in slicer or parameters ? What is the output you want?

 

Best Regards,
Winniz

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.