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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
Mal_Sondh
Helper II
Helper II

Maximum Flag/Value over 2 columns

Hi,

 

If i wanted to create a filter for a chart and only wanted to include the Max Versions per Month end, how can i do this - example data as follows

 

Snap KeySnap DateMonth EndVersion
12021-02-022021-01-311
22021-02-062021-01-312
32021-03-022021-02-281
42021-04-022021-03-301
52021-04-042021-03-302
62021-04-042021-03-303

 

When i apply the filter i should only see the following:

Snap KeySnap DateMonth EndVersion
22021-02-062021-01-312
32021-03-022021-02-281
62021-04-042021-03-303

 

Any help would be appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Mal_Sondh 

You can create a measure and then put the measure in the filter .

max version =

var max_version=CALCULATE(MAX('Table'[Version]),ALLEXCEPT('Table','Table'[Month End]))

return IF(SELECTEDVALUE('Table'[Version])=max_version,1,0)

Then put the measure in the filter ,set the value is equal to 1 ,

Ailsa-msft_0-1623204006082.png

The effect is as shown :

Ailsa-msft_1-1623204006085.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

 

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
Anonymous
Not applicable

Hi @Mal_Sondh 

You can create a measure and then put the measure in the filter .

max version =

var max_version=CALCULATE(MAX('Table'[Version]),ALLEXCEPT('Table','Table'[Month End]))

return IF(SELECTEDVALUE('Table'[Version])=max_version,1,0)

Then put the measure in the filter ,set the value is equal to 1 ,

Ailsa-msft_0-1623204006082.png

The effect is as shown :

Ailsa-msft_1-1623204006085.png

I have attached my pbix file ,you can refer to it .

 

Best Regards

Community Support Team _ Ailsa Tao

 

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

@Mal_Sondh , Create measure like these for snap key and version and use with Month, take max of date if needed

 

Version =
VAR __id = MAX ('Table'[Month ] )
VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[Month ] = __id )
CALCULATE ( max ('Table'[End Version] ), VALUES ('Table'[Month] ),'Table'[Month] = __id,'Table'[Date] = __date )

 

Snap =
VAR __id = MAX ('Table'[Month ] )
VAR __date = CALCULATE ( MAX('Table'[Date] ), ALLSELECTED ('Table' ), 'Table'[Month ] = __id )
CALCULATE ( max ('Table'[Snap Key] ), VALUES ('Table'[Month] ),'Table'[Month] = __id,'Table'[Date] = __date )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

so the name of the table is Snapshot - are you referencing any other tables above in your query?

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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