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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 47 | |
| 43 | |
| 26 | |
| 19 |
| User | Count |
|---|---|
| 196 | |
| 127 | |
| 102 | |
| 67 | |
| 49 |