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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
How can I pull in data on a bi-weekly basis? For example, I want to pull all data from a historical pay edit employee table from 7/15- 7/28. Once it reaches 7/29, I want data ONLY from 7/29 - 8/11, and same thing for once it reaches 8/12 (only want data from 8/12-8/25). Is there a way to write a query so that this can be performed?
The requirement is not very clear. You may check if the DAX below helps.
Table =
VAR d =
TODAY ()
RETURN
FILTER (
'Table1',
[Date]
>= DATE ( YEAR ( d ) - 1, MONTH ( d ), DAY ( d ) )
&& [Date]
<= DATE ( YEAR ( d ) - 1, MONTH ( d ), DAY ( d ) )
+ 13
)
@v-chuncz-msft Sorry if I wasn't clear with my requirements, but I'm pulling the data from SQL Server. I don't want to hardcode the dates like I do in my existing statement, so I believe you understood what I was trying to get at. But my question is where do I use a DAX expression like the one you wrote in your post? Is that a query for an entire table? How would I integrate such a query with my existing sql statement below to pull the data:
declare @start_date datetime
declare @end_date datetime
--Date/time when we want to extract from
select @start_date = '2018-07-14 14:35'
select @ened_date = '2018-07-28 14:35'
--Pull all histedits marked as Pay Adjust Paid
select * From hist_edit
where status_id = 6
and insert_ts > @start_date
and insert_ts < @end_date
order by hist_edit_id
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |