Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Solved! Go to Solution.
Hello @Anonymous
Give this a try, you will just need to change the table and column names to match your data.
Filtered Sales = CALCULATETABLE( Sales, DATESBETWEEN ( Sales[Sales Date], DATE(2019,1,15), DATE(2019,2,5) ) )
This creates a new table called 'Filtered Sales' that is the Sales table filtered to 1/15/2019 - 2/5/2019
How can I create a measure to get the values for one specific date,
I created a variable for the date, but the calculate(measure, filter(date=variable date)) returns a blank result
Hi @Anonymous ,
You can set date range directly.
Table = VAR DateStart = DATE ( "2018", "1", "5" ) VAR DateEnd = DATE ( "2018", "1", "15" ) RETURN CALCULATETABLE ( TEST, FILTER ( TEST, TEST[Date] <= DateEnd && TEST[Date] >= DateStart ) )
Or you can set a start time and time interval to define your date range.
Table 2 = VAR DateStart = DATE ( "2018", "1", "1" ) RETURN CALCULATETABLE ( TEST, DATESINPERIOD ( TEST[Date], DateStart, 15, DAY ) )
You can define the time interval by day, month, season, year. Here is the documentation for DATESINPERIOD() function.
https://docs.microsoft.com/en-us/dax/datesinperiod-function-dax
These two DAX queries return a same table. You can choose one of them.
Here is my test file, you can click the following link and download it.
Best Regards,
Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous
Give this a try, you will just need to change the table and column names to match your data.
Filtered Sales = CALCULATETABLE( Sales, DATESBETWEEN ( Sales[Sales Date], DATE(2019,1,15), DATE(2019,2,5) ) )
This creates a new table called 'Filtered Sales' that is the Sales table filtered to 1/15/2019 - 2/5/2019
Hello, is there any option using the filter parameter used in the report? Because i'm trying but the selected date not filter
Thank you so much! Your method worked for me
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
64 | |
51 | |
39 | |
26 |
User | Count |
---|---|
86 | |
55 | |
44 | |
43 | |
36 |