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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AgustinLopez
Frequent Visitor

Get the value of a column subject to the max value of another colum

Hello!, I'm new with this of Power Bi, and I'm struggling to get a Dax formula to work properly.

I have the following in example.

Week           Kilos
1                  10
2                  20
3                  30
4                  40

And also, a slicer with the weeks.

I need a Dax that shows in a label the kilos of the week that is max of the slicer.
I.e.
Slicer is from week 2-4, the label has to show 40 Kilos
if Slicer is from week 2-3, the label has to show 30 kilos

Thanks for your help in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AgustinLopez , Try a measure like

meausre =
var _max = maxx(allselected(Table), Table[week])
return
calculate(sum(Table[Kilos]), filter(Table, Table[week] =_max))

 

But better to have separate week table

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @AgustinLopez 

If you are going to use the measure in a card visual, this should suffice:

Measure =  MAX(Table1[Kilos])

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

amitchandak
Super User
Super User

@AgustinLopez , Try a measure like

meausre =
var _max = maxx(allselected(Table), Table[week])
return
calculate(sum(Table[Kilos]), filter(Table, Table[week] =_max))

 

But better to have separate week table

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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