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

Compare date between two tables and count

I have two date tables.

Main table has multiple date column, One column name is "date" another is "TDate" .

I have created a date table with the columns "date range" and "start of month date"

Connected them with 1 to many betwwen date column and date range column.

 

I need to count the date if date < start of month date

In excel formula looks like countif(date,"<"&start of month date)


I tried using calculate(count(date),date<start month date) but not really getting a result. Any suggestions>

 

eshanpacheriwal_0-1638283841990.png         

eshanpacheriwal_1-1638283877234.png

 

 

 

Required table visualisation

eshanpacheriwal_2-1638283899405.png

 

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Try this measure

Count = CALCULATE(COUNT('Table'[Date Range]),FILTER(ALL('Table'),[Date Range]<MAX('Table (2)'[Start Month])))+0

vstephenmsft_0-1638521338174.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.

lbendlin
Super User
Super User

remove the join between the tables and decide if this needs to be a measure or if it can be a calculated column. Use SELECTEDVALUE() or ALLEXCEPT()

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.

Top Solution Authors