Forum Discussion

denisedf's avatar
denisedf
Frequent Visitor
5 years ago
Solved

Create a Column with range From-To comma separated using DAX

Hello everyone, I have FROM/TO columns with the starting and ending numbers from a range and I am wondering if there is an easy way in DAX to create a column with the range values comma separated ...
  • denisedf's avatar
    denisedf
    5 years ago

    Hi I tried your solution but I was getting an error message that I could not have more than one record per line or something.

    I was able to create all the values what I needed using this:

    check from/to tails =
    var alltails = CONCATENATEX(VALUES(TAILS_POWERBI),TAILS_POWERBI[Tails],",") //this is a table that lists all the values and I concatenate them comma separated
    var startPosition = SEARCH(MAX(MODSUM_VIEW[FROMPSN]),alltails) //here I define which is the from value position
    var endPosition = (SEARCH(MAX(MODSUM_VIEW[TOPSN]),alltails))+5 //here I define which is the to value position (+5 because my values are always 5 digits long)
    var fromto_range = mid(alltails,startPosition,endPosition-startPosition) (here I build the values from/to based on the positions
    return fromto_range

    This is what it looks like: