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

MAX of dates

Hello,

 

I want to get the max of the two selected dates and flag it as 1 if it is equal to the MAX of the selected date.

Selected dates from the slicer:

Ishan25_0-1595843655202.png

Table:

Ishan25_1-1595843886981.png

Here in the table of the selected dates i want to flag the smaller date as 0 and latest selected date as 1.

 

Can you please help

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , try like
measure =
var _max = maxx(allselected(Date),Date[date])
return
if(max(Table[asofdate]) = _max ,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

View solution in original post

6 REPLIES 6
Fowmy
Super User
Super User

@Anonymous 

Is Cross Filtering form (Format Tab> Interaction) enabled between these two visuals? 




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Anonymous , try like
measure =
var _max = maxx(allselected(Date),Date[date])
return
if(max(Table[asofdate]) = _max ,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
Anonymous
Not applicable

Hi,

 

When i select other dates like as shown in screenshot it does not work:

Ishan25_0-1595847157764.png

Here the previous date should show flag as  0 but it is showing as 1:

Ishan25_1-1595847258894.png

 

 

Anonymous
Not applicable

Hi @amitchandak 

 

I am facing one problem with the solution.

I have selected two dates in my slicer but when i filter the records (example filter applied on a item location code ) present only in the past date using the filter pane the measure returns 1 eventhough i have selected two dates in myslicer.

I get how the measure is working on the basis of data present in the filter and as the visual has only one date it will show as 1.

I want the measure values to be based on the selection in slicer only and not on the visual data.

 

Can you please help me with that as wothout this my another measure(which uses the date measure too) changes it's value as the user filters further more

@Anonymous , check i tried the same

Screenshot 2020-07-27 16.53.31.png

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

Hi @amitchandak 

 

Thank you for the solution it worked as expected.

 

Previously i selected only  one filter from the report level filter and that is why i was confused.

 

But now i understood. Thank you for the help.🙂

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.