Forum Discussion
Ahmed_Gamal
3 years agoNew Member
Add value to specific column in matrix
I want to add the G/L value (red column) to only the column number 1 in matrix table and not to show on the other columns like the pic. I added it as measure but it appear om all coumns the point i...
- 3 years ago
Hi Ahmed_Gamal ,
I think your table maybe like this:
Please create two new columns:
G/L = SWITCH( TRUE(), 'Table'[Cost] < 0 && 'Table'[Journal Name] = 1, "G", 'Table'[Cost] > 0 && 'Table'[Journal Name] = 1, "L") New_percent = IF('Table'[Percent] <> BLANK(), 'Table'[Percent]*100 & "%")Create a new table:
Table 2 = UNION( SELECTCOLUMNS('Table',"Journal Name",[Journal Name],"Group Name",[Group Name],"Type","Cost","Value",[Cost]), SELECTCOLUMNS('Table',"Journal Name",[Journal Name],"Group Name",[Group Name],"Type","Percent","Value",[New_percent]), SELECTCOLUMNS('Table',"Journal Name",[Journal Name],"Group Name",[Group Name],"Type","G/L","Value",[G/L]) )You will get a new table like this. Please note: the type of value column is text.
I think this is the result uou want:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yadongf-msft
3 years agoCommunity Support
Hi Ahmed_Gamal ,
I think your table maybe like this:
Please create two new columns:
G/L = SWITCH(
TRUE(),
'Table'[Cost] < 0 && 'Table'[Journal Name] = 1, "G",
'Table'[Cost] > 0 && 'Table'[Journal Name] = 1, "L")
New_percent = IF('Table'[Percent] <> BLANK(), 'Table'[Percent]*100 & "%")
Create a new table:
Table 2 =
UNION(
SELECTCOLUMNS('Table',"Journal Name",[Journal Name],"Group Name",[Group Name],"Type","Cost","Value",[Cost]),
SELECTCOLUMNS('Table',"Journal Name",[Journal Name],"Group Name",[Group Name],"Type","Percent","Value",[New_percent]),
SELECTCOLUMNS('Table',"Journal Name",[Journal Name],"Group Name",[Group Name],"Type","G/L","Value",[G/L])
)
You will get a new table like this. Please note: the type of value column is text.
I think this is the result uou want:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.