Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

How to create a range from Column values

 Hello,

I'm looking to create a range out of the values of Lower Limit Column

The data is laid out in two columns as shown in Current Data and the Expected outcome is below it.  

 

Current Data:                                                                                 

Expected Outcome :

 

 

Thank you,

5 Replies

  • Range (calculated) = 
    var nextValue = CALCULATE(MIN('Table'[Range]), FILTER(ALL('Table'), 'Table'[Range] > EARLIER('Table'[Range])))
    return IF(nextValue > 0, 
        'Table'[Range] & " - " & nextValue,
        "> " & 'Table'[Range]
    )

    You can try something like the above

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for your reply.

      It does create a range but not accurate, here is my output.

      Looks like the variable needs to be tied to the bucket column, so the range is locked to the adjacent bucket value.  

       

  • Hi,

    You should ideally be creating this as a calculated column formula in the Table (not as a measure).  Are you OK with my approach?

    • Anonymous's avatar
      Anonymous
      Not applicable

      I tried this as Calculated column, range is not accurate. Check out my screenshot

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        If you are OK with my approach of creating a calculated column formula rather than a measure, then share the download link of the PBI file.