Forum Discussion

Martin_Songstad's avatar
Martin_Songstad
Frequent Visitor
3 years ago
Solved

How to check whether a value is between two values on the same row of a (possibly sliced) table

Hi!

 

My age group table is nice and small, with min and max values (days) per age group (years):

 

Users should be able to slice the data by ages, by selecting 81 and 83-year olds, but not 82-year olds, for instance.

In my measure, I have calculated the age (days) on the day of an event in [Alder]. If i filter the data like this:

... i get the correct answer for the 81-year-olds and the 83-year-olds respectively, but my totals will include values from 82-year-olds, and we can't have that.

This filter fixes that, 

but replacing my neat age-group-table with this huge generated one just feels wrong. 

Surely, there must be a better way to check whether the value is between two values on the same row of my age group table. 

 

Any ideas?

 

Martin

 

  • Solved it myself by iterating the measure over the age groups! Thanks!

    If you have even better ideas, feel free to share.

1 Reply

  • Solved it myself by iterating the measure over the age groups! Thanks!

    If you have even better ideas, feel free to share.