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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
bpsearle
Resolver II
Resolver II

Problem with dynamic filters

Hi all,

I'm trying to create a dynamic filter that works with a measure but can't get it working. I've put together a test jig to show the problem

 

Any help will be gratefully received

 

Thanks, Brian

 

Example.jpg

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

Try

Measure 3 = 
VAR __date = MAX ( Table1[DATE] )
VAR __city = CALCULATE ( MAX( Table1[CITY]), ALLSELECTED ( Table1 ),  Table1[DATE] = __date ) 
RETURN CALCULATE ( [M Score] ), VALUES ( Table1[CITY] ), Table1[CITY] = __city, Table1[DATE] = __date )

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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

View solution in original post

Hi @amitchandak 

Well done and thank you.

Playing around with the code I found I didn't need the reference to City and the cause of the problem was that I needed to have the 'latest visit date' not as a separate measure but as a variable in the main measure. Not sure I fully understand this yet, need to do some more experimenting!

Thanks

Brian

View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

@bpsearle 

Try:

M latest score =

CALCULATE ([M score],
FILTER(ALL(table1),

table1[date] = [M latest visit]))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown 

Thank you for your reply.

This didn't work. It seems to be something to do with the latest visit date being a separate measure, if it's a variable in the main measure it works.

Thanks, Brian

amitchandak
Super User
Super User

Try

Measure 3 = 
VAR __date = MAX ( Table1[DATE] )
VAR __city = CALCULATE ( MAX( Table1[CITY]), ALLSELECTED ( Table1 ),  Table1[DATE] = __date ) 
RETURN CALCULATE ( [M Score] ), VALUES ( Table1[CITY] ), Table1[CITY] = __city, Table1[DATE] = __date )

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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

Hi @amitchandak 

Well done and thank you.

Playing around with the code I found I didn't need the reference to City and the cause of the problem was that I needed to have the 'latest visit date' not as a separate measure but as a variable in the main measure. Not sure I fully understand this yet, need to do some more experimenting!

Thanks

Brian

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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