Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have to show Maximum value and Max-1 value based on ID,
I dont have date column
Max column should show values only for Max id and Max-1 rows should show as Blank()
Min column should show values only for Max-1 id and Max rows should show as Blank()
Solved! Go to Solution.
Hi, @BhavyaM
If there is any other column in your table to identify each row of data?
Based on the information you currently provide, I have modified your original measure as below:
Max1 =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'A'[ID] ) = MAXX ( ALL ( A ), A[ID] ), SELECTEDVALUE ( A[VALUE] ),
SELECTEDVALUE ( 'A'[ID] ) = MINX ( ALL ( A ), A[ID] ), BLANK ()
)
Min1 =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'A'[ID] ) = MAXX ( ALL ( A ), A[ID] ), BLANK (),
SELECTEDVALUE ( 'A'[ID] ) = MINX ( ALL ( A ), A[ID] ), SELECTEDVALUE ( A[VALUE] )
)
Please check my sample file for more details.
If it doen't meet your requirement,please let me know.
Best Regards,
Community Support Team _ Eason
Hi, @BhavyaM
If there is any other column in your table to identify each row of data?
Based on the information you currently provide, I have modified your original measure as below:
Max1 =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'A'[ID] ) = MAXX ( ALL ( A ), A[ID] ), SELECTEDVALUE ( A[VALUE] ),
SELECTEDVALUE ( 'A'[ID] ) = MINX ( ALL ( A ), A[ID] ), BLANK ()
)
Min1 =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'A'[ID] ) = MAXX ( ALL ( A ), A[ID] ), BLANK (),
SELECTEDVALUE ( 'A'[ID] ) = MINX ( ALL ( A ), A[ID] ), SELECTEDVALUE ( A[VALUE] )
)
Please check my sample file for more details.
If it doen't meet your requirement,please let me know.
Best Regards,
Community Support Team _ Eason
@BhavyaM , All values are same, How will min and max be different ?
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
I am considering Latest and Latest-1 ID and calculating it value.
ID | VALUE | Current ID Value | Previous ID Value |
2020121713 | 1254.39 | 1254.39 | 1254.39 |
2020121713 | 1254.39 | 1254.39 | 1254.39 |
2020121713 | 1254.39 | 1254.39 | 1254.39 |
2020121713 | 1254.39 | 1254.39 | 1254.39 |
2020121713 | 0.332 | 0.332 | 0.332 |
2020121713 | 0.332 | 0.332 | 0.332 |
2020121713 | 0.332 | 0.332 | 0.332 |
2020121713 | 0.332 | 0.332 | 0.332 |
2020121713 | 0.332 | 0.332 | 0.332 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 0 | 0 | 0 |
2020121617 | 276.955 | 276.955 | 276.955 |
2020121617 | 3442.63 | 3442.63 | 3442.63 |
2020121617 | 258.491 | 258.491 | 258.491 |
2020121617 | 3442.63 | 3442.63 | 3442.63 |
2020121617 | 3442.63 | 3442.63 | 3442.63 |
2020121617 | 3442.63 | 3442.63 | 3442.63 |
2020121617 | 3442.63 | 3442.63 | 3442.63 |
2020121617 | 0.916 | 0.916 | 0.916 |
2020121617 | 0.916 | 0.916 | 0.916 |
2020121617 | 0.916 | 0.916 | 0.916 |
2020121617 | 0.916 | 0.916 | 0.916 |
2020121617 | 0.916 | 0.916 | 0.916 |
2020121617 | 0 | 0 | 0 |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.