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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Anonymous
Not applicable

need to find details related to latest date in Policy based on date selected in the Slicer.

Hi Guys, I am facing an issue in getting a solution for finding details related to the latest date in policy based on date range selected using the slicer.

 

Date used. - 

Kaushlendra_EY_0-1651237972419.png

I want to get details related to the latest date when the status is "In Progress" for policy x.

 

I have made a measure flag 

Max Flag = IF(MAX(Sheet1[Date]) = CALCULATE(MAX(Sheet1[Date]),ALLEXCEPT(Sheet1,Sheet1[Policy])),1,0)
 
this is working fine when the complete date range is selected in the slicer means till 5 June 2022 but when I reduce the slicer range it is not giving data corresponding to 1 Feb 2021 the table is getting blank. Instead, it is giving values related to both 1 Feb 2021 and 4 May 2020. I want only value corresponding to 1 Feb 2021 when Slicer is moved to left a little.
I want the flag to be dynamic based on slicer range.
 
I am attaching the file PBIX file. 
 
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Modify it.

Max Flag = IF(MAX(Sheet1[Date]) = CALCULATE(MAX(Sheet1[Date]),FILTER(ALLSELECTED(Sheet1),[Policy]=MAX('Sheet1'[Policy]))),1,0)

The final output is shown below:

vyalanwumsft_0-1651646987793.png


Best Regards,
Community Support Team _ Yalan Wu
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
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Modify it.

Max Flag = IF(MAX(Sheet1[Date]) = CALCULATE(MAX(Sheet1[Date]),FILTER(ALLSELECTED(Sheet1),[Policy]=MAX('Sheet1'[Policy]))),1,0)

The final output is shown below:

vyalanwumsft_0-1651646987793.png


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

Anonymous
Not applicable

Above code is not working.

amitchandak
Super User
Super User

@Anonymous ,

try like

Max Flag = IF(MAX(Sheet1[Date]) = CALCULATE(MAX(Sheet1[Date]),ALLSELECTED(Sheet1[Policy])),1,0)

or

 

Max Flag = IF(MAX(Sheet1[Date]) = CALCULATE(MAX(Sheet1[Date]),ALLSELECTED()),1,0)

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.