Forum Discussion
Fall a value in a Range
- 5 years ago
Hi Anonymous ,
Try this:
Measure = VAR _CurrentDueDays = MAX ( Table1[DueDays] ) VAR _MIN = CALCULATE ( MAX ( Table2[Min] ), Table2[Min] <= _CurrentDueDays ) VAR _MAX = CALCULATE ( MIN ( Table2[Max] ), Table2[Max] >= _CurrentDueDays ) VAR _Bracket = CALCULATE ( MAX ( Table2[Bracket] ), Table2[Min] = _MIN, Table2[Max] = _MAX ) RETURN IF ( _CurrentDueDays >= _MIN && _CurrentDueDays <= _MAX, _Bracket )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Column =
VAR __range = CALCULATE ( MAX ( 'Table'[Id] ) )
RETURN
CALCULATE ( MAX ( Range[Range] ), __range >= Range[Min], __range <= Range[Max] )
Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- Anonymous5 years agoNot applicable
parry2k Thank you for your response.
I created the following calculated column:
Column2 =VAR __range = CALCULATE ( MAX ( 'Table'[ID] ) )RETURNCALCULATE ( MAX ( 'Table'[Bracket] ), __range >= 'Table'[Min], __range <= 'Table'[Max])But it only gets the first bracket, In this case 0-30. The column should get all the brackets. - Anonymous5 years agoNot applicable
parry2k and it should compare the DueDays value column coming in the other table e.g. If DueDays=65 then it should fall into 60-90 Bracket.