Forum Discussion
Multiple rows into one based on similar column values
- Anonymous2 years ago
Hi techlog ,
Based on my testing, please try the following methods:
1.Create the sample table.
2.Create the new index column.
3.Create the new measure to display multiple ID rows into single row.
Multiple ID = var _index = SELECTEDVALUE('Table'[Index]) VAR _id = SELECTEDVALUE('Table'[Emp ID]) RETURN IF(CALCULATE(SELECTEDVALUE('Table'[Emp ID]),FILTER(ALL('Table'),'Table'[Index] = _index-1)) = _id,BLANK(),_id)4.Create the new measure for each column that have multiple rows.
Multi Name = var _index = SELECTEDVALUE('Table'[Index]) VAR _name = SELECTEDVALUE('Table'[Name]) RETURN IF(CALCULATE(SELECTEDVALUE('Table'[Name]),FILTER(ALL('Table'),'Table'[Index] = _index-1)) = _name,BLANK(),_name)Multiple category = var _index = SELECTEDVALUE('Table'[Index]) VAR _cat = SELECTEDVALUE('Table'[Category]) RETURN IF(CALCULATE(SELECTEDVALUE('Table'[Category]),FILTER(ALL('Table'),'Table'[Index] = _index-1)) = _cat,BLANK(), _cat)5.Drag the measure into the table.
6.The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi techlog ,
To do this, you can use matrix visual in Power BI and then in setting change to tabular view.
Result:
Use matrix visual:
And change to Tabular layout.
| Memorable Member | Former Super User If I helped, please accept the solution and give kudos! |
Hi lkalawski
Thanks for the help.
In the example I have just posted 3 columns, the concern here is if we have 10-12 columns or if the number of columns are more. We do not have the functionality of horizontal scrolling in the Matrix visual (Solved: PowerBI Matrix widget not showing horizonal scroll... - Power Platform Community (microsoft.com)) and in that case we were not able to see all the columns available in the matrix.
So this solution will not work for the case where number of columns are more and require horizontal scrolling.