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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

want to make a meaure accordingly

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 ACol B
132
2312
47
62
6575
612
2253
21
343
122
6723
7676

 

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 AMeasure (Col B=20)
10
231
40
60
651
60
221
20
341
120
671
761

 

Now if I select value of COl B in the slicer as 30 then:

Col AMeasure (Col B=30)
10
230
40
60
651
60
220
20
341
120
671
761
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@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

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

To create a calculated table contains col B:

T-ColB = SUMMARIZE('Table','Table'[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:

vangzhengmsft_0-1629101953586.png

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

View solution in original post

2 REPLIES 2
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

To create a calculated table contains col B:

T-ColB = SUMMARIZE('Table','Table'[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:

vangzhengmsft_0-1629101953586.png

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

amitchandak
Super User
Super User

@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

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.