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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.