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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Timo123
Frequent Visitor

Only show last value in matrix

I have the following tables:


Dates

Values

 

And the following matrix:

 

Weeknumber     Value

1                         50

2                         60

3                         70

4                         80

5                         90

 

I want to create a measure that makes the matrix looks like the example below, moving with a slicer on weeknumbers (so in this example, its 1 to 5, but the value moves if its set to 3 or 6):

 

Weeknumber     Value

1                         

2                         

3                         

4                         

5                         90

 

I tried multiple measures I've found online, but none seem to work. I either get the max value per week or just the max value of week 5 on every week. How do I keep older weeks empty while having a value for the max week selected by the slicer?

 

Thank you in advance!

2 REPLIES 2
314mp_M0th4
Resolver I
Resolver I

Could you post your current measure? Using Allselected as a condition in Calculate might fix this.

 

Edit: Okay you want the slicer to only affect the value column. This is a bit complicated. You may need a new table for the data, lets call it T2. Then instead of a matrix use table visualization. Make a new measurement:

Filtered values = Selectedvalue(T2[Value])

Use the weeks from T1 as the first column and the values from T2 as the next column, and the slicer will take in weeks from T2.

 

The end goal for the measure is to have a line chart with 3 values: current year, year -1 and a value marker just for the last week of the current year. So it doesnt necessarily have to be in a matrix or a table, as long as it just takes the value of the current year value of only the last week so I can have dynamic labels in the line chart visual that move when the slider for the weeks moves. 

 

The easy non-dynamic method would be:

 

Label = CALCULATE([Value Measure],FILTER('Date','Date'[Year]=YEAR(TODAY())&&'Date'[WeekNum]=WEEKNUM(TODAY())))
 
which works fine, but means I cant select an older week and have the label move dynamically with the slicer.

Helpful resources

Announcements
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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