Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have 2 columns both having the whole numbers in the range of 1 to 90, let's call them Col A and Col B.
I am using Col B as a slicer in Power BI.
I want to make a measure that gives me 1 if the value of Col A >= max value of Col B as selected in the slicer (as mentioned I am using Col A as slicer), else 0.
Here the max value of col B refers to the max selected value of Col B.
Here is the sample data:
| Table | |
| Col A | Col B |
| 1 | 32 |
| 23 | 12 |
| 4 | 7 |
| 6 | 2 |
| 65 | 75 |
| 6 | 12 |
| 22 | 53 |
| 2 | 1 |
| 34 | 3 |
| 12 | 2 |
| 67 | 23 |
| 76 | 76 |
Now I am using Col B as a slicer and the selected value is 20.
Now I want a table with COL A and the required measure as:
| Col A | Measure (Col B=20) |
| 1 | 0 |
| 23 | 1 |
| 4 | 0 |
| 6 | 0 |
| 65 | 1 |
| 6 | 0 |
| 22 | 1 |
| 2 | 0 |
| 34 | 1 |
| 12 | 0 |
| 67 | 1 |
| 76 | 1 |
Now if I select value of COl B in the slicer as 30 then:
| Col A | Measure (Col B=30) |
| 1 | 0 |
| 23 | 0 |
| 4 | 0 |
| 6 | 0 |
| 65 | 1 |
| 6 | 0 |
| 22 | 0 |
| 2 | 0 |
| 34 | 1 |
| 12 | 0 |
| 67 | 1 |
| 76 | 1 |
Solved! Go to Solution.
@Anonymous , try a measure like
measure =
var _max = maxx(allselected(Table), Table[ColB])
return
calculate(count(Table[Col A]), filter(Table, Table[Col b] >= _max)) +0
if you need sum
measure =
var _max = maxx(allselected(Table), Table[ColB])
return
calculate(Sum(Table[Col A]), filter(Table, Table[Col b] >= _max)) +0
Hi, @Anonymous
To create a calculated table contains col B:
Then create a measure like this:
_result =
VAR _maxB =
CALCULATE ( MAX ( 'T-ColB'[Col B] ), ALLSELECTED ( 'T-ColB'[Col B] ) )
RETURN
IF ( MAX ( 'Table'[Col A] ) >= _maxB, 1, 0 )
result:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @Anonymous
To create a calculated table contains col B:
Then create a measure like this:
_result =
VAR _maxB =
CALCULATE ( MAX ( 'T-ColB'[Col B] ), ALLSELECTED ( 'T-ColB'[Col B] ) )
RETURN
IF ( MAX ( 'Table'[Col A] ) >= _maxB, 1, 0 )
result:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@Anonymous , try a measure like
measure =
var _max = maxx(allselected(Table), Table[ColB])
return
calculate(count(Table[Col A]), filter(Table, Table[Col b] >= _max)) +0
if you need sum
measure =
var _max = maxx(allselected(Table), Table[ColB])
return
calculate(Sum(Table[Col A]), filter(Table, Table[Col b] >= _max)) +0
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.