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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
angeleyes_7181
Regular Visitor

Sameperiod from date range but for a selected year from Year filter

Hi I am working on a measure where the counts are dependant on the date range selected. There is another measure where I have to calculate the counts for the date and month from the date range slicer but year from a chosen Year filter. I am using a date dimension table for date range and year filters

 

Appreciate if anyone can help with this

 

Capture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @angeleyes_7181 

Select Date Slicer, Click the format and select edit interactions. Click the None to disconnect the two slicers 

vyohuamsft_0-1718936215295.png

vyohuamsft_1-1718936713217.png

 

 

You can learn more from the following link:

Change how visuals interact in a report - Power BI | Microsoft Learn

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

3 REPLIES 3
angeleyes_7181
Regular Visitor

@Anonymous  Thanks for your reply but the above doesn't work. I should be able to select a year irrespective of daterange and teh calculation should give me values for the selected year but for range for day and month from the date range filter

 

Anonymous
Not applicable

Hi, @angeleyes_7181 

Select Date Slicer, Click the format and select edit interactions. Click the None to disconnect the two slicers 

vyohuamsft_0-1718936215295.png

vyohuamsft_1-1718936713217.png

 

 

You can learn more from the following link:

Change how visuals interact in a report - Power BI | Microsoft Learn

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

Anonymous
Not applicable

Hi, @angeleyes_7181 

I create a sample table:

vyohuamsft_1-1718329826419.png

 

You can try the following DAX expression:

SamePeriodCount = 
VAR SelectedYear = SELECTEDVALUE('Table'[Year])
VAR StartDate = MIN('Table'[Date])
VAR EndDate = MAX('Table'[Date])
VAR SamePeriodLastYear1 = 
    CALCULATE(
        COUNT('Table'[ColumnToCount]), 
        FILTER(
            ALL('Table'), 
            'Table'[Year] = SelectedYear && 
            'Table'[Date] >= StartDate && 
            'Table'[Date] <= EndDate
        )
    )
RETURN
SamePeriodLastYear1

 

vyohuamsft_0-1718329758137.png

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.