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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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