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! Learn more

Reply
Anonymous
Not applicable

Selected Dates from Slicer to a Measure

Hi All,

 

I have a DATE Slicer and a Table Table1 with multiple date fields. I wanted to calculate measures based on a calendar slicer (based on start and end date) and filter the Table1 on a specific date field. Is this possible to calculate the measure dynamic during selection.

 

Table 1:

 

ID Date1 Date3 Date3

 

Measure 1 : COUNT(ID) based on Date1 and Based on the Slicer Selction

Measure 2 : COUNT(ID) based on Date2 and Based on Slicer selction

 

Can this be done without having inactive relationships with the date coulmn of the date table .?

 

Aju

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Sorry for taking so long to reply. For some reason, my reply was not sent successfully before.

 

1.Create a calendar table.

Calendar = CALENDAR(DATE(2021,1,1),DATE(2021,1,11))

vstephenmsft_2-1637116007739.png

 

2.Create three measures.

Measure 1 Value = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Date1]>=MIN('Calendar'[Date])&&[Date1]<=MAX('Calendar'[Date])))
Measure 2 Value = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Date2]>=MIN('Calendar'[Date])&&[Date2]<=MAX('Calendar'[Date])))
Measure 3 Value = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Date3]>=MIN('Calendar'[Date])&&[Date3]<=MAX('Calendar'[Date])))

vstephenmsft_3-1637116052740.png

 

 

Best Regards,

Stephen Tao

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

Sorry for taking so long to reply. For some reason, my reply was not sent successfully before.

 

1.Create a calendar table.

Calendar = CALENDAR(DATE(2021,1,1),DATE(2021,1,11))

vstephenmsft_2-1637116007739.png

 

2.Create three measures.

Measure 1 Value = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Date1]>=MIN('Calendar'[Date])&&[Date1]<=MAX('Calendar'[Date])))
Measure 2 Value = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Date2]>=MIN('Calendar'[Date])&&[Date2]<=MAX('Calendar'[Date])))
Measure 3 Value = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Date3]>=MIN('Calendar'[Date])&&[Date3]<=MAX('Calendar'[Date])))

vstephenmsft_3-1637116052740.png

 

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

Updated with the sample data. I have a date slicer for sel;ecting dates.

Anonymous
Not applicable

IDDate1Date2Date3
11/1/20211/4/20211/6/2021
21/2/20211/5/20211/7/2021
31/3/20211/6/20211/8/2021
41/4/20211/7/20211/9/2021
51/5/20211/8/20211/10/2021
61/6/20211/9/20211/11/2021

 

 

Date Slicer Selected Date :1/3/2021 - 1/6/2021 
Measure 1 Value = 4Calculation based on Date1
Measure 2 value = 3Calculation based on Date2
Measure 3 Value=1

Calculation based on Date3

 

VijayP
Super User
Super User

@Anonymous 

I think you need to share sample data and also the desired result to give you the right answer




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors