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
Anonymous
Not applicable

Count with Filter that has two dates on a line visual

I have two tables called DateTbl and ItemTbl. DateTbl is my date lookup while ItemTbl has columns named Item_Number, Start_Date and End_Date. My relationship is on Start_Date with the DateTbl.

However, I want to count item_Number based on Start_Date and End_Date in the filter expression and create a line visual with the count Item on y-axis and Date[Date] on x-axis but I am struggling to get it work since it involves Start_Date and EndDate and relationship is on Start_Date.
For example, I hard coded Start_Date and End_date the dax below:

CALCULATE (
    COUNT ('Item_Tbl'[Item_Number]),
    
       FILTER('Item_Tbl','Item_Tbl'[Start_Date] <= DATE(2021,10,18)),
       OR('Item_Tbl'[End_Date] > DATE(2021,10,18)
           ,'Item_Tbl'[End_Date] = BLANK())
        )

But I don't want to hard code the date from ItemTbl and want place it in a line chart.

and the Date looks at the last 3 months.

Please help

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Seem very similar to active employee of HR, refer

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Seem very similar to active employee of HR, refer

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you. it works

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