Forum Discussion
denisedf
5 years agoFrequent Visitor
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 ...
- 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:
Ashish_Mathur
5 years agoSuper User
Hi,
If you want filters and slicers to work, then all numbers should be in one column with each number in its own row. This can be done easily in the Query Editor. Would you be interested in that solution?
denisedf
5 years agoFrequent Visitor
Ashish_Mathur The problem of having each number in one column in its own row is that I have currently 430000+ rows of data to which, many of these rows the From/to is From = 55001 and To = 59999.
I would easily end up with 2 billion rows.
- Ashish_Mathur5 years agoSuper User
Hi,
But unless you do that, you will not be able to select individual numbers via filter/slicers.