cancel
Showing results for
Did you mean:

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

Frequent Visitor

## Apply a value in matrix to one column only

Heelo everyone!

I was wondering... I don't even know if this is possible but it is worth a try...

I have a matrix with some names as rows, years as columns and some values.

I have been asked to change the configuration of the matrix so that one of the values only appears for the current year, and not for the rest of the columns. I don't know if I am making myself very clear...

This is the header of my matrix, and what I would like is for the measure "Dif. Inv. Ant" to appear only for the column 2022 and not for the other years...is this possible?

1 ACCEPTED SOLUTION
Community Support

There is no way to directly modify only the measure to be applied to a column. Even if the result of the measure is empty, there will still be a space in that column.
We can do this by modifying the Columns of the matrix. Use the following formula to create a custom column for the matrix.

Year = union(VALUES('Table'[Date].[Year]),{"Dif.Inv.Ant"})

Then, we use a measure called the merge measure as the values of the matrix table.
merge measure =

IF ( SELECTEDVALUE ( 'Year'[Year] ) = "Dif.Inv.Ant", CALCULATE ( [Dif.Inv.Ant], FILTER ( 'Table', [Date].[Year] = YEAR ( TODAY () ) ) ), [Inv.Act] )

The result looks like this:

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

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

3 REPLIES 3
Community Champion

Check out this article. Let me know if you need further help:

Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!

Community Support

There is no way to directly modify only the measure to be applied to a column. Even if the result of the measure is empty, there will still be a space in that column.
We can do this by modifying the Columns of the matrix. Use the following formula to create a custom column for the matrix.

Year = union(VALUES('Table'[Date].[Year]),{"Dif.Inv.Ant"})

Then, we use a measure called the merge measure as the values of the matrix table.
merge measure =

IF ( SELECTEDVALUE ( 'Year'[Year] ) = "Dif.Inv.Ant", CALCULATE ( [Dif.Inv.Ant], FILTER ( 'Table', [Date].[Year] = YEAR ( TODAY () ) ) ), [Inv.Act] )

The result looks like this:

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

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

Super User

@eugeniaCastilla , You can create a calculation group of you measures and have code for measure you want to hide like

if(Max(Date[Year]) =2021 ,[Measure2], blank())

Other can be simply the measures

I have not tested this

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Announcements

#### Power BI Monthly Update - November 2023

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

#### Fabric Community News unified experience

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

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### 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