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
hokiefan1113
Advocate I
Advocate I

Handling bi-weekly data

 

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? 

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@hokiefan1113,

 

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
    )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@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

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.