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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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)

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)

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors