cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
smpa01 Senior Member
Senior Member

DAX to return max of corresponding column based on slicer selection

Hello experts,

 

My raw data is following.

 

NameDatePeriod
Jan1/1/20191
Feb2/1/20192
Mar3/1/20193
Apr4/1/20194

 

I am passing on the Name as slicer to the users of the report.

 

Capture.PNG

What I am hoping for DAX to return is the corresoponding max value of the Period when multiples values are selected from the slicer. For example,

 

when the selection is following

Capture.PNG

 

I am hoping for DAX to return following

Capture.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: DAX to return max of corresponding column based on slicer selection

I would expect in this scenario that the simple MAX( column ) would work too

Max Period = MAX('Table'[Period])

View solution in original post

Super User
Super User

Re: DAX to return max of corresponding column based on slicer selection

Seems to work for me, see Page 4 and Table 7 in attached.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

7 REPLIES 7
Super User
Super User

Re: DAX to return max of corresponding column based on slicer selection

Probably something along the lines of:

 

MAXX(ALLSELECTED('Table'),[Period])


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

smpa01 Senior Member
Senior Member

Re: DAX to return max of corresponding column based on slicer selection

@Greg_Deckler  thanks for the reponse.

 

So far, I tried this. But did not get what I wanted. Since I am passing the Name to create slicer, ALLSELECTED does not see the corresponding period number in MAXX. SELECTEDVALUE does see the correponding value based on the slicer from the same table but does not allow MAXX to be applied on it.

Capture.PNG

Super User
Super User

Re: DAX to return max of corresponding column based on slicer selection

I would expect in this scenario that the simple MAX( column ) would work too

Max Period = MAX('Table'[Period])

View solution in original post

smpa01 Senior Member
Senior Member

Re: DAX to return max of corresponding column based on slicer selection

@d_gosbelltested. It did not work. If you have a workbook where it works would be great if you can please upload/share/show.

Super User
Super User

Re: DAX to return max of corresponding column based on slicer selection

Seems to work for me, see Page 4 and Table 7 in attached.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Super User
Super User

Re: DAX to return max of corresponding column based on slicer selection

It works for my single table model (see attached)

smpa01 Senior Member
Senior Member

Re: DAX to return max of corresponding column based on slicer selection

Thanks a lot @d_gosbell and @Greg_Deckler 

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (1,303)