cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Ahmed_Gamal
New 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 is it possible to apply it to just the first column or not

1.png

 

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @Ahmed_Gamal ,

 

I think your table maybe like this:

vyadongfmsft_0-1669015541576.png

 

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 & "%")

 

vyadongfmsft_1-1669015600026.png

 

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.

vyadongfmsft_2-1669015756450.png

 

I think this is the result uou want:

vyadongfmsft_4-1669015919150.png

 

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.

View solution in original post

5 REPLIES 5
v-yadongf-msft
Community Support
Community Support

Hi @Ahmed_Gamal ,

 

I think your table maybe like this:

vyadongfmsft_0-1669015541576.png

 

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 & "%")

 

vyadongfmsft_1-1669015600026.png

 

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.

vyadongfmsft_2-1669015756450.png

 

I think this is the result uou want:

vyadongfmsft_4-1669015919150.png

 

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.

mangaus1111
Solution Sage
Solution Sage

Hi @Ahmed_Gamal ,

you can use the conditional formatting on a measure  ( green if gain, red if loss) and maybe putting the journal name in the row, not in the column.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

the same problem 
the colors set to the all columns not only the first one

FreemanZ
Super User
Super User

header of multiple layers and merged cells are really not friendly to data analysis. what is your expected result?

i want a (gain or lose by if function) for the first coulmn only according to the cost value.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors