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
Tihannah
Resolver II
Resolver II

Creating Pay Period Start and End Dates from Calendar Table?

I have my main calendar table but would like to create a slicer based on Pay Period Start and End dates. Specifically to show both as one column, i.e.  11/17/23 - 11/30/23 (which is an actual pay period date range) and can be put into a dropdown filter for selection. I've looked and looked, but can't seem to find an example of this in any previously posted questions. Any help would be much appreciated!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Tihannah 

Thanks@JamesFR06 and @lbendlin, I have the following additions. Based on your description, I use the following sample data:

vjianpengmsft_0-1709886658142.png

I created a slicer with date and set the slicer style to between:

vjianpengmsft_1-1709886826909.png

I stitched together the maximum and minimum values in the slicer into a single line with the following DAX:

 

MEASURE =
VAR _start =
    CALCULATE ( MIN ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
VAR _End =
    CALCULATE ( MAX ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
RETURN
    _start & "-" & _End

 

Select different start and end dates through slicer for dynamic splicing:

vjianpengmsft_2-1709887039164.png

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi, @Tihannah 

Thanks@JamesFR06 and @lbendlin, I have the following additions. Based on your description, I use the following sample data:

vjianpengmsft_0-1709886658142.png

I created a slicer with date and set the slicer style to between:

vjianpengmsft_1-1709886826909.png

I stitched together the maximum and minimum values in the slicer into a single line with the following DAX:

 

MEASURE =
VAR _start =
    CALCULATE ( MIN ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
VAR _End =
    CALCULATE ( MAX ( 'Date'[Date] ), ALLSELECTED ( 'Date' ) )
RETURN
    _start & "-" & _End

 

Select different start and end dates through slicer for dynamic splicing:

vjianpengmsft_2-1709887039164.png

 

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

JamesFR06
Resolver IV
Resolver IV

HI

 

I did it 2 times

The first one with a filter on date on filter panel

The second one, i have created a second date table ofr the required period and linked it to my date table

Are these pay periods depending on any user supplied filters?  If not then there is no point in trying to compute them over and over again.  Use an external reference table.

No. They will be the only filter on the dashboard.  @JamesFR06  is there supposed to be an attachment or link to your post? 

No just to tell you how i ve managed the tips

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.