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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
rinabernardo
Frequent Visitor

DAX: Value in one table that lands between a minimum and maximum in another table

I have 2 tables, one containing a value and another with details of date ranges. Here are the details:

 

TCERs Data table contains the Age in Days for each TCER.

TCER idCreation DateAge in Days
XXXXMM/DD/YYYY6

 

Age Groups table contains rows for each date range (1-7, 8-14,...) along with corresponding Minimum and Maximum values. The table looks like this:

RangeMinimumMaximum
01-0717
08-14814

 

I need a measurement (that can be placed on a timeline) which will count the number of TCERs whose Age in Days falls between the minimum and maximum of a specified range.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rinabernardo ,

 

Please create a measure.

Measure = CALCULATE(COUNTROWS('TCER data table'),FILTER(ALL('TCER data table'),'TCER data table'[Age in Days]<=SELECTEDVALUE('Table'[Maximum])&&'TCER data table'[Age in Days]>=SELECTEDVALUE('Table'[Minimum])))

333.PNG

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

 

 

Best Regards

Community Support Team _ Polly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @rinabernardo ,

 

Please create a measure.

Measure = CALCULATE(COUNTROWS('TCER data table'),FILTER(ALL('TCER data table'),'TCER data table'[Age in Days]<=SELECTEDVALUE('Table'[Maximum])&&'TCER data table'[Age in Days]>=SELECTEDVALUE('Table'[Minimum])))

333.PNG

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

 

 

Best Regards

Community Support Team _ Polly

TomMartens
Super User
Super User

Hey @rinabernardo ,

 

I assume this article describes what you are looking for: Dynamic segmentation – DAX Patterns

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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