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
jcastr02
Post Prodigy
Post Prodigy

matrix value - show only last week but only for one of the values

Hello Im using a matrix visual and have two columns I'm pulling into values.  (Reduced Hours and HTS Category ) these are displayed by week. 

 

However, I only want the the HTS Category value to show for the last reporting week, I don't need to see it for previous weeks.  I would like to see the Reduced Hours for every week.  does anyone have any suggestions?  Essentially Id like to just shows the areas in yellow and not ones in RedScreenshot 202.png

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

Hi @jcastr02 ,

You can create a measure as below and replace the field [HTS Category] with this new measure on the matrix visual.

Measure =
VAR _maxweek =
    CALCULATE ( MAX ( '***ReducedHours'[Week] ), ALLSELECTED ( '***ReducedHours' ) )
RETURN
    IF (
        SELECTEDVALUE ( '***ReducedHours'[Week] ) = _maxweek,
        MAX ( '***ReducedHours'[HTS Category] ),
        BLANK ()
    )

vyiruanmsft_0-1701246009724.png

If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @jcastr02 ,

You can create a measure as below and replace the field [HTS Category] with this new measure on the matrix visual.

Measure =
VAR _maxweek =
    CALCULATE ( MAX ( '***ReducedHours'[Week] ), ALLSELECTED ( '***ReducedHours' ) )
RETURN
    IF (
        SELECTEDVALUE ( '***ReducedHours'[Week] ) = _maxweek,
        MAX ( '***ReducedHours'[HTS Category] ),
        BLANK ()
    )

vyiruanmsft_0-1701246009724.png

If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

Thanks so much @v-yiruan-msft  !! I got this to work.  Is there a way to get the previous weeks columns to not show at all (show only the reduced hours column for previous weeks, but not the others)
Screenshot 2023-11-29 091426.png

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.