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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rinabernardo
New Member

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
v-rongtiep-msft
Community Support
Community Support

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
v-rongtiep-msft
Community Support
Community Support

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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