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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.