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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Filter latest data as per slicer slicer selection

I have KPI data for stores for different month and I have a month Slicer.

My data looks something like this.

Store_Number  Month         Score

S1                      July-2019     1

S1                      Aug-2019     0

 

If I select July, then I should get score as 1 and if I select July and Aug in the slicer, I should see just 0- since that is the score based on the last visit to the store.

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

Hi @Anonymous ,

 

You could use the maximum of date to find the correct score. Here is a measure for your reference.

Measure =
LOOKUPVALUE (
    'Table'[Score],
    'Table'[Month], CALCULATE ( MAX ( 'Table'[Month] ), ALLSELECTED ( 'Table'[Month] ) )
)

 

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

View solution in original post

4 REPLIES 4
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could use the maximum of date to find the correct score. Here is a measure for your reference.

Measure =
LOOKUPVALUE (
    'Table'[Score],
    'Table'[Month], CALCULATE ( MAX ( 'Table'[Month] ), ALLSELECTED ( 'Table'[Month] ) )
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

LookupValue function doesn't work for a measure. Score here is a measure. Can you please suggest what can be used for a measure?

mussaenda
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCjZU0lHyKs2p1DUyMLQEsg2VYnWgwo6l6TBRA6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Store_Number = _t, Month = _t, Score = _t]),
    #"Duplicated Column" = Table.DuplicateColumn(Source, "Month", "Month - Copy"),
    #"Changed Type" = Table.TransformColumnTypes(#"Duplicated Column",{{"Month", type date}}),
    #"Duplicated Column2" = Table.DuplicateColumn(#"Changed Type", "Month", "Month - Copy - Copy"),
    #"Extracted Month" = Table.TransformColumns(#"Duplicated Column2",{{"Month - Copy - Copy", Date.Month, Int64.Type}}),
    #"Duplicated Column1" = Table.DuplicateColumn(#"Extracted Month", "Month", "Month - Copy.1"),
    #"Extracted Year" = Table.TransformColumns(#"Duplicated Column1",{{"Month - Copy.1", Date.Year, Int64.Type}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Extracted Year", {{"Month - Copy.1", type text}, {"Month - Copy - Copy", type text}}, "en-GB"),{"Month - Copy.1", "Month - Copy - Copy"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"Merged")
in
    #"Merged Columns"

 

Based on the data you provided, you can try the code above:

 

2019_11_13_10_26_27_Untitled_Power_BI_Desktop.png

Anonymous
Not applicable

Hi @Anonymous Please use below measure 

MaxOfSelectedMonth = CALCULATE(MAX(Data[Score]),ALLSELECTED(Data[Month]))

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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