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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dynamic MAX for all rows

I have a table that looks like this:

H1H2H3H4H5# Layers
John Smith    1
John SmithMary Jane   2
John SmithMary JaneAndrew Johnson  3
John SmithMary JaneAndrew JohnsonAriel Parker 4
John SmithMary JaneAndrew JohnsonMark Williams 4
John SmithMary JaneJackson Mills  3
John SmithMary JaneJackson MillsJustin Hunt 4
John SmithMary JaneJackson MillsJustin HuntJanet Lind5

 

I want to add a column that shows the Max value of the Layers column among all the rows.

So for the way the table is right now, all the rows in the max column should be 5.

But I want the max to change acoording to the filter. So if I filter Andrew Johnson in H3, the max column should be 4. 

The user can filter any of those columns (H1, H2, H3, H4 or H5)

5 REPLIES 5
DataInsights
Super User
Super User

@Anonymous, is there one slicer for each column (H1, H2, etc.), or is there one slicer that filters multiple columns?





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

Proud to be a Super User!




Anonymous
Not applicable

@DataInsights There is one slicer for each column. Depending on who the user is, they are going to filter on H1, or H2, etc. So if I'm Andrew, for example, I'm gonna use the H3 slicer because my name is in the 3rd hierarchy

@Anonymous, try this measure:

 

Max Layer H3 = 
VAR vSelName =
    SELECTEDVALUE ( Layers[H3] )
VAR vMaxLayer =
    CALCULATE ( MAX ( Layers[# Layers] ), ALL ( Layers ), Layers[H3] = vSelName )
RETURN
    vMaxLayer

 

DataInsights_0-1599077613337.png

 

You can replicate this logic for each column's slicer (H1, H2, etc.).





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

Proud to be a Super User!




Anonymous
Not applicable

@DataInsights I need the max to be just one column, not 5 different ones 😕 

@Anonymous, revised measure:

 

Max Layer = 
CALCULATE ( MAX ( Layers[# Layers] ), ALLSELECTED ( Layers ) )




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

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.