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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply

start date and end date range selection to get count

chintusasmal123_0-1746109085340.png

 This is my data set , 
Where I have active relationship with end date and inactive with start date 
I'm filter users with slicer selected value for LineManager column and when friday column value is true

Friday = VAR FilteredData =
    CALCULATETABLE(
        FILTER(
      'RWDataset',
        (RWDataset[LMEmail] = SELECTEDVALUE(DupEmails[Value])
       // || RWDataset[UHEmail] = SELECTEDVALUE(DupEmails[Value]) || RWDataset[SHEmail] = SELECTEDVALUE(DupEmails[Value])
         ) &&
        'RWDataset'[RWFriday] = TRUE()
       && (RWDataset[start-date] <= [1 Selected Start Date] ||
          RWDataset[end-date] >= [2 Selected End Date]))
    ,USERELATIONSHIP('Date'[Date],RWDataset[start-date]))

VAR DistinctEmployees =
    DISTINCT(SELECTCOLUMNS(FilteredData, "EmployeeIDColumn", 'RWDataset'[RequestorEmail]))

RETURN COUNTROWS(DistinctEmployees)


Using this measure to find disctinct employee name 
When the date range slicer is from 01-03-2025 to 30-06-2025 value is coming correct i.e 7 
but when i select date range from 01-04-2025 to 30-04-2025 value coming is zero , but it should be 5 , either start date must be before the range's start date and less than range's end date and end date can be greater or equal to but greater than start date , I can't really getting confuse with the logic here.
1 ACCEPTED SOLUTION

Instead of

 

CALENDAR([start-date],[end-date])

 

you can use a list

 

{[start-date],[end-date]} 

 

if you really want to check only for these two dates.

View solution in original post

8 REPLIES 8
v-hashadapu
Community Support
Community Support

Hi @chintusasmal123 , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.

v-hashadapu
Community Support
Community Support

Hi @chintusasmal123 , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.

v-hashadapu
Community Support
Community Support

Hi @chintusasmal123 , Thank you for reaching out to the Microsoft Community Forum.

Please let us know if your issue is solved. If it is, consider marking the answers that helped 'Accept as Solution', so others with similar queries can find them easily. If not, please share the details.
Thank you.

lbendlin
Super User
Super User

You need to use a disconnected calendar table for this.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

 

IDRequestor NameLineManagerstart-dateend-dateRWWithin24HrRWWorkigOptionRWMondayRWTuesdayRWWednesdayRWThursdayRWFriday
6630MDCS01/02/202512/03/2025TRUE FALSEFALSETRUEFALSETRUE
7022NSCS27/02/202510/03/2025TRUE TRUETRUETRUETRUETRUE
7616SRCS24/04/202509/05/2025TRUE TRUETRUETRUETRUETRUE
6412PPCS01/01/202527/06/2025TRUE FALSEFALSEFALSETRUETRUE
6420CDCS02/01/202527/06/2025TRUE FALSEFALSEFALSETRUETRUE
6424SVCS02/01/202527/06/2025TRUE FALSEFALSEFALSETRUETRUE
7629NMCS23/04/202530/06/2025TRUE TRUETRUETRUETRUETRUE


When a user select a date range from 01-03-2025 to 30-04-2025  then any employee who's start date falls inbetween the date range or earlier showed be shown and also who's end date falls inbetween or greater should be shown , for example here Chintan is doing work from home 02/01/2025 till 27/06/2025 that mean he falls between the date range of 01-03-2025 to 30-04-2025

6420CDCS02/01/202527/06/2025

lbendlin_0-1746120783234.png

 

Now if I select date range from 01/04/2025 to 30/06/2025 , I'm getting wrong value rather I should have got 5 all record either start date or end date falls in that range 

Instead of

 

CALENDAR([start-date],[end-date])

 

you can use a list

 

{[start-date],[end-date]} 

 

if you really want to check only for these two dates.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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