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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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 )

Share with Power BI Enthusiasts: 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.