Forum Discussion
Anonymous
7 years agoNot applicable
Create Table - How to go to the next column (Using Distinct)
Hello,
I would like to create a Table with three column,
Data[TripReference] (Distincted)
Data[DaysAway]
Data[CostCenterCode]
Tried ADDCOLUMNS, but I think I'm not getting the systax right.
NewData = ADDCOLUMNS(
"TripReference" ; DISTINCT(VALUES(Data[TripReference])) ;
"DaysAway" ; VALUES(Data[DaysAway]);
"CostCentre" ; VALUES(Data[CostCenterCode])
)
Please advise..
Anonymous -
I replied to post https://community.powerbi.com/t5/Desktop/Calculated-Columns-that-relate-to-like-row-grouping/m-p/753289#M363013, using ADDCOLUMNS ( DISTINCT ...
Maybe that will help.
2 Replies
- jdbuchanan71Super User
Hello Anonymous
ADDCOLUMNS needs a table as the first argument, you are adding columns to the table you list. Give this a try:
NewData = SUMMARIZE(Data,Data[TripReference],Data[DaysAway],Data[CostCenterCode])
- ChrisMendozaResident Rockstar
Anonymous -
I replied to post https://community.powerbi.com/t5/Desktop/Calculated-Columns-that-relate-to-like-row-grouping/m-p/753289#M363013, using ADDCOLUMNS ( DISTINCT ...
Maybe that will help.