Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
using DAX how to calculate min and max for this table, based on the attribute color and they have to be in the same sequence , for example red -3 and red -6 are not considered in the same group as 3 and 6 are not in a continuous order
Solved! Go to Solution.
Hi @mim
Please see the attached file with the solution.
The file contains
Calculated column
rankColorGroup =
VAR __previousColor = 'Table'[color]
RETURN
RANKX (
FILTER ( 'Table', 'Table'[color] <> __previousColor ),
'Table'[order],,,
DENSE
)
Two Measures
min =
CALCULATE(
MIN( 'Table'[order] ),
ALL( 'Table' ),
VALUES( 'Table'[rankColorGroup] )
)
max =
CALCULATE(
MAX( 'Table'[order] ),
ALL( 'Table' ),
VALUES( 'Table'[rankColorGroup] )
)
Hi @mim
Please see the attached file with the solution.
The file contains
Calculated column
rankColorGroup =
VAR __previousColor = 'Table'[color]
RETURN
RANKX (
FILTER ( 'Table', 'Table'[color] <> __previousColor ),
'Table'[order],,,
DENSE
)
Two Measures
min =
CALCULATE(
MIN( 'Table'[order] ),
ALL( 'Table' ),
VALUES( 'Table'[rankColorGroup] )
)
max =
CALCULATE(
MAX( 'Table'[order] ),
ALL( 'Table' ),
VALUES( 'Table'[rankColorGroup] )
)
Hi, I tried to use solution proposed but when individual values are one after another there is an error in calculation. Do you have some idea how to fix this, I have no idea how to fix this.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |