Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

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

 

eugeniaCastilla_0-1647859651390.png

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? 

 

 

Thanks in advance!

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

Hi  @Anonymous , 

 

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:

vchenwuzmsft_0-1648107209526.png

 

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.

View solution in original post

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

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

https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1... 





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!
Paul on Linkedin.






v-chenwuz-msft
Community Support
Community Support

Hi  @Anonymous , 

 

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:

vchenwuzmsft_0-1648107209526.png

 

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.

amitchandak
Super User
Super User

@Anonymous , 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
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/

 

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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